Esempio n. 1
0
File: yify.py Progetto: noba3/KoTos
def LINK(name, murl, thumb):
    xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)")
    main.GA("Yify", "Watched")
    stream_url = False
    ok = True
    infoLabels = main.GETMETAT(name, '', '', thumb)
    video_type = 'movie'
    season = ''
    episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }
    stream_url = main.resolve_url(murl)
    try:
        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre'],
            'originaltitle': infoLabels['metaName']
        }
        # play with bookmark
        from resources.universal import playbackengine
        if stream_url: main.CloseAllDialogs()
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=infoLabels['title'],
            season=season,
            episode=episode,
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory(addon_id)
            wh.add_item(name + ' ' + '[COLOR green]Yify[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels='',
                        img=img,
                        fanart='',
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 2
0
def LINK(name,murl,thumb):
    xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)")
    main.GA(prettyName,"Watched")
    stream_url = False
    ok=True
    infoLabels =main.GETMETAT(name,'','',thumb)
    video_type='movie'
    season=''
    episode=''
    img=infoLabels['cover_url']
    fanart =infoLabels['backdrop_url']
    imdb_id=infoLabels['imdb_id']
    infolabels = { 'supports_meta' : 'true', 'video_type':video_type, 'name':str(infoLabels['title']), 'imdb_id':str(infoLabels['imdb_id']), 'season':str(season), 'episode':str(episode), 'year':str(infoLabels['year']) }
    link=main.OPENURL(murl)
    
    keys=re.findall('(?sim)vkey=(.+?)&',link)
    
    if keys:
        vurl='http://www.pinit.tv/embedplayer.php?width=620&height=465&vkey='+keys[0]+'&autoplay=true&subtitles='
        link=main.OPENURL(vurl)
        key=re.findall('href="(rtmp://[^"]+?)">Play',link)
        stream_url = key[0]
        id=re.findall('rtmp://.+?/pinit/(\d+)_.+?.mp4',key[0])[0]
    else:
        urllist=[]
        epiList=[]
        match=re.findall('(?sim)<a href="([^"]+?)" target="_blank">([^<]+?)</a>',link)
        for url,epi in match:
            urllist.append(url)
            epiList.append(epi)
        dialog = xbmcgui.Dialog()
        ret = dialog.select('[COLOR=FF67cc33][B]Select Episode[/COLOR][/B]',epiList)
        if ret == -1:
            return
        link2=main.OPENURL(urllist[ret])
        key=re.findall('href="(rtmp[^"]+?)">Play',link2)
        
        stream_url = key[0]
        id=re.findall('rtmp://.+?/pinit/(\d+)_.+?.mp4',key[0])[0]
        name=epiList[ret]
    try:
        infoL={'Title': name, 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName']}
        # play with bookmark
        from resources.universal import playbackengine
        if stream_url: main.CloseAllDialogs()
        player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=infoLabels['title'],season=season, episode=episode, year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id)
        player.setSubtitles('http://www.pinit.tv/subs/'+id+'.srt')
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory(addon_id)
            wh.add_item(name+' '+'[COLOR green]'+prettyName+'[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=img, fanart='', is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 3
0
def LISTSP(murl):
    #urllist=main.OPENURL('http://oneclickwatch.org/category/movies/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/2/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/3/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/4/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/5/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/6/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/7/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/8/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/9/')+main.OPENURL('http://oneclickwatch.org/category/movies/page/10/')
    urllist = main.batchOPENURL(
        ('http://oneclickwatch.org/category/movies/',
         'http://oneclickwatch.org/category/movies/page/2/',
         'http://oneclickwatch.org/category/movies/page/3/',
         'http://oneclickwatch.org/category/movies/page/4/',
         'http://oneclickwatch.org/category/movies/page/5/',
         'http://oneclickwatch.org/category/movies/page/6/',
         'http://oneclickwatch.org/category/movies/page/7/',
         'http://oneclickwatch.org/category/movies/page/8/',
         'http://oneclickwatch.org/category/movies/page/9/',
         'http://oneclickwatch.org/category/movies/page/10/'))
    if urllist:
        urllist = main.unescapes(urllist)
        match = re.compile(
            'title=".+?">([^<]+)</a></h2>.+?href=".+?<a href="(.+?)" .+?href=".+?>.+?src="(.+?)"'
        ).findall(urllist)
        dialogWait = xbmcgui.DialogProgress()
        ret = dialogWait.create('Please wait until Movie list is cached.')
        totalLinks = len(match)
        loadedLinks = 0
        remaining_display = 'Movies loaded :: [B]' + str(
            loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
        dialogWait.update(0, '[B]Will load instantly from now on[/B]',
                          remaining_display)
        for name, url, thumb in match:
            name = name.replace('<strong>', '').replace('</strong>', '')
            main.addPlayM(name, url, 135, thumb, '', '', '', '', '')
            loadedLinks = loadedLinks + 1
            percent = (loadedLinks * 100) / totalLinks
            remaining_display = 'Movies loaded :: [B]' + str(
                loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
            dialogWait.update(percent,
                              '[B]Will load instantly from now on[/B]',
                              remaining_display)
            if (dialogWait.iscanceled()):
                return False
    dialogWait.close()
    del dialogWait
    main.CloseAllDialogs()
    main.GA("HD", "Oneclickwatch")
Esempio n. 4
0
def LINKSP3(mname, url):
    main.GA("Dailyfix", "Watched")
    sources = []
    ok = True
    xbmc.executebuiltin(
        "XBMC.Notification(Please Wait!,Collecting Hosts,8000)")
    infoLabels = main.GETMETAT(mname, '', '', '')
    video_type = 'movie'
    season = ''
    episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }
    link = main.OPENURL(url)
    match = re.compile(
        "<a href='(.+?)' class='.+?' title='.+?' rel='.+?'>.+?</a").findall(
            link)
    import urlresolver
    main.CloseAllDialogs()
    for murl in match:
        host = re.compile("http://(.+?)\.[^/]+?/.+?").findall(murl)
        for hname in host:
            hname = hname.replace('www.', '').title()
            hosted_media = urlresolver.HostedMediaFile(url=murl,
                                                       title="[COLOR blue]" +
                                                       hname + "[/COLOR]")
            sources.append(hosted_media)
    if (len(sources) == 0):
        xbmc.executebuiltin(
            "XBMC.Notification(Sorry!,Movie doesn't have playable links,5000)")
    else:
        source = urlresolver.choose_source(sources)
    try:
        if source:
            xbmc.executebuiltin(
                "XBMC.Notification(Please Wait!,Actual HD Movie Requires Buffer Time,7000)"
            )
            stream_url = main.resolve_url(source.get_url())
        else:
            stream_url = False
            return
        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname + ' ' + '[COLOR green]DailyFix[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 5
0
def LINKSP3(mname, murl):
    main.GA("DL4Free", "Watched")
    msg = xbmcgui.DialogProgress()
    msg.create('Please Wait!', '')
    msg.update(0, 'Collecting hosts')
    link = main.OPENURL(murl)
    link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(
        '&nbsp;', '').replace('&#38;', '&')
    sources = []
    titles = []
    ok = True
    match0 = re.compile(
        '(?sim)<div class="meta">Download Links</div>.*?</div>').findall(link)
    match1 = []
    match2 = []
    if match0:
        match2 = re.compile('(?sim)<p.*?</p>').findall(match0[0])
        for paragraph in reversed(match2):
            match1 += re.compile('<a href="([^"]+?)"').findall(paragraph)
    match = []
    paragraphs = re.compile('(?sim)<code>.+?</code>').findall(link)
    for paragraph in paragraphs:
        domains = re.compile('https?://([^"]+?)/[^<^\]]+').findall(paragraph)
        urls = re.compile('(https?://[^"]+?/[^<^\]]+)').findall(paragraph)
        for d in domains:
            if domains.count(d) > 1:
                while d in domains:
                    index = domains.index(d)
                    domains.pop(index)
                    urls.pop(index)
        match += urls
#         match=re.compile('<a href="([^<]+)">htt').findall(link)
    match = match1 + match
    mainlinks = len(match1)
    numpar = len(match2)
    hostsmax = len(match)
    h = 0
    from urlparse import urlparse
    for url in match:
        h += 1
        percent = (h * 100) / hostsmax
        msg.update(percent, 'Collecting hosts - ' + str(percent) + '%')
        if msg.iscanceled(): break
        vlink = re.compile('rar|part\d+?(\.html)?$|/folder/').findall(url)
        if len(vlink) == 0:
            firstword = mname.partition(' ')[0]
            if re.search('(?i)' + mname.partition(' ')[0], url):
                if re.search('(?i)1080p?', mname):
                    if not re.search('(?i)1080p?', url): continue
                if re.search('(?i)720p', mname):
                    if not re.search('(?i)720p?', url): continue
            if re.search('(?i)1080p?', mname):
                if re.search('(?i)720p|dvdrip|480p/|xvid', url): continue
            if re.search('(?i)720p?', mname):
                if re.search('(?i)1080p?|dvdrip|480p|xvid', url): continue
            if re.search('(?i)xvid|480p',
                         mname) or not re.search('(?i)1080p?|720p?', mname):
                if re.search('(?i)1080p?|720p?', url): continue
#                 url = url.replace('ul.to','uploaded.net')
            host = urlparse(url).hostname.replace('www.', '').partition('.')[0]
            hostname = host
            host = host.upper()
            if h <= mainlinks and numpar == 1: quality = mname
            else: quality = url
            match3 = re.compile('(?i)(720p?|1080p?)').findall(quality)
            if match3 and not 'p' in match3[0]: match3[0] += 'p'
            match4 = re.compile('mp4').findall(url)
            if len(match3) > 0:
                host = host + ' [COLOR red]' + match3[0] + '[/COLOR]'
            elif len(match4) > 0:
                host = host + ' [COLOR green]SD MP4[/COLOR]'
            else:
                host = host + ' [COLOR blue]SD[/COLOR]'
            if main.supportedHost(hostname):
                titles.append(host)
                sources.append(url)
    msg.close()
    if (len(sources) == 0):
        xbmc.executebuiltin(
            "XBMC.Notification(Sorry!,Could not find a playable link,3000)")
        return
    else:
        dialog = xbmcgui.Dialog()
        index = dialog.select('Choose your stream', titles)
        if index != -1:
            source = sources[index]
        else:
            source = None
    try:
        if not source:
            main.CloseAllDialogs()
            return
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,5000)")
        stream_url = main.resolve_url(source)
        if (stream_url == False):
            return

        if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I):
            mname = mname.split('&')[0]
            infoLabels = main.GETMETAEpiT(mname, '', '')
            video_type = 'episode'
            season = infoLabels['season']
            episode = infoLabels['episode']
        else:
            infoLabels = main.GETMETAT(mname, '', '', '')
            video_type = 'movie'
            season = ''
            episode = ''
        img = infoLabels['cover_url']
        fanart = infoLabels['backdrop_url']
        imdb_id = infoLabels['imdb_id']
        infolabels = {
            'supports_meta': 'true',
            'video_type': video_type,
            'name': str(infoLabels['title']),
            'imdb_id': str(infoLabels['imdb_id']),
            'season': str(season),
            'episode': str(episode),
            'year': str(infoLabels['year'])
        }

        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre'],
            'originaltitle': infoLabels['metaName']
        }
        if not video_type is 'episode':
            infoL['originalTitle'] = main.removeColoredText(
                infoLabels['metaName'])
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname + ' ' + '[COLOR green]DL4Free[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 6
0
def LINKSP3(mname, murl):
    main.GA("Rls1Click", "Watched")
    msg = xbmcgui.DialogProgress()
    msg.create('Please Wait!', '')
    msg.update(0, 'Collecting hosts')
    link = main.OPENURL(murl)
    link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(
        '&nbsp;', '').replace('&#38;', '&')
    sources = []
    titles = []
    urls = []
    ok = True
    paragraphs = re.compile(
        '(?sim)<strong>1-Click</strong>.*?<strong>1GB Links</strong>').findall(
            link)
    for paragraph in paragraphs:
        urls = re.compile('href="(https?://[^<^\]^"]+)"').findall(paragraph)
#         match=re.compile('<a href="([^<]+)">htt').findall(link)
#     match = match1 + match
    print urls
    hostsmax = len(urls)
    h = 0
    from urlparse import urlparse
    for url in urls:
        h += 1
        percent = (h * 100) / hostsmax
        msg.update(percent, 'Collecting hosts - ' + str(percent) + '%')
        if msg.iscanceled(): break
        if '1fichier' in url:
            host = '1fichier'
        else:
            host = urlparse(url).hostname.replace('www.', '').partition('.')[0]
        hostname = host
        host = host.upper()
        if main.supportedHost(hostname):
            titles.append(host + ' [COLOR red]1080P[/COLOR]')
            sources.append(url)
    msg.close()
    if (len(sources) == 0):
        xbmc.executebuiltin(
            "XBMC.Notification(Sorry!,Could not find a playable link,3000)")
        return
    else:
        dialog = xbmcgui.Dialog()
        index = dialog.select('Choose your stream', titles)
        if index != -1:
            source = sources[index]
        else:
            source = None
    try:
        if not source:
            main.CloseAllDialogs()
            return
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,5000)")
        stream_url = main.resolve_url(source)
        if (stream_url == False):
            return

        if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I):
            mname = mname.split('&')[0]
            infoLabels = main.GETMETAEpiT(mname, '', '')
            video_type = 'episode'
            season = infoLabels['season']
            episode = infoLabels['episode']
        else:
            infoLabels = main.GETMETAT(mname, '', '', '')
            video_type = 'movie'
            season = ''
            episode = ''
        img = infoLabels['cover_url']
        fanart = infoLabels['backdrop_url']
        imdb_id = infoLabels['imdb_id']
        infolabels = {
            'supports_meta': 'true',
            'video_type': video_type,
            'name': str(infoLabels['title']),
            'imdb_id': str(infoLabels['imdb_id']),
            'season': str(season),
            'episode': str(episode),
            'year': str(infoLabels['year'])
        }

        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre'],
            'originaltitle': infoLabels['metaName']
        }
        if not video_type is 'episode':
            infoL['originalTitle'] = main.removeColoredText(
                infoLabels['metaName'])
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname + ' ' + '[COLOR green]DL4Free[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 7
0
def VIDEOLINKSSCENE(mname, murl, thumb):
    main.GA(prettyName, "Watched")
    msg = xbmcgui.DialogProgress()
    msg.create('Please Wait!', '')
    msg.update(0, 'Collecting hosts')
    link = main.OPENURL(murl)
    sources = []
    titles = []
    ok = True
    playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    playlist.clear()
    paragraphs = re.compile('(?sim)<p.*?</p>').findall(link)
    match = []
    for paragraph in paragraphs:
        domains = re.compile(
            '<a href="https?://([^"]+?)/[^"]+(?!jpg|gif|jpeg|png)" rel="nofollow">htt'
        ).findall(paragraph)
        urls = re.compile(
            '<a href="([^"]+)(?!jpg|gif|jpeg|png)" rel="nofollow">htt'
        ).findall(paragraph)
        for d in domains:
            if domains.count(d) > 1:
                while d in domains:
                    index = domains.index(d)
                    domains.pop(index)
                    urls.pop(index)
        match += urls
    hostsmax = len(match)
    h = 0
    from urlparse import urlparse
    for url in match:
        h += 1
        percent = (h * 100) / hostsmax
        msg.update(percent, 'Collecting hosts - ' + str(percent) + '%')
        if msg.iscanceled(): break
        vlink = re.compile('rar|part\d+?(\.html)?$|/folder/').findall(url)
        if len(vlink) == 0:
            url = re.sub('(?i)\.html$', '', url)
            filename = re.compile('(?i)/([^/]*?\..{3,4})$').findall(url)
            if filename: filename = " [" + filename[0] + "]"
            else: filename = ""
            firstword = mname.partition(' ')[0]
            if re.search('(?i)' + mname.partition(' ')[0], url):
                if re.search('(?i)1080p?', mname):
                    if not re.search('(?i)1080p?', url): continue
                if re.search('(?i)720p', mname):
                    if not re.search('(?i)720p?', url): continue
            if re.search('(?i)lumfile.com|freakshare.com', url):
                if not re.search('(?i)' + mname.partition(' ')[0], url):
                    continue
            if re.search('(?i)1080p?', mname):
                if re.search('(?i)720p|dvdrip|480p/|xvid', url): continue
            if re.search('(?i)720p?', mname):
                if re.search('(?i)1080p?|dvdrip|480p|xvid', url): continue
            if re.search('(?i)xvid|480p',
                         mname) or not re.search('(?i)1080p?|720p?', mname):
                if re.search('(?i)1080p?|720p?', url): continue
#                 url = url.replace('ul.to','uploaded.net')
            host = urlparse(url).hostname.replace('www.', '').partition('.')[0]
            hostname = host
            host = host.upper()
            quality = url
            match3 = re.compile('(?i)(720p?|1080p?)').findall(quality)
            if match3 and not 'p' in match3[0]: match3[0] += 'p'
            match4 = re.compile('mp4').findall(url)
            if len(match3) > 0:
                host = host + ' [COLOR red]' + match3[0] + '[/COLOR]'
            elif len(match4) > 0:
                host = host + ' [COLOR green]SD MP4[/COLOR]'
            else:
                host = host + ' [COLOR blue]SD[/COLOR]'
            if main.supportedHost(hostname):
                titles.append(host + filename)
                sources.append(url)
    msg.close()
    if (len(sources) == 0):
        xbmc.executebuiltin(
            "XBMC.Notification(Sorry!,Could not find a playable link,3000)")
        return
    else:
        dialog = xbmcgui.Dialog()
        index = dialog.select('Choose your stream', titles)
        if index != -1:
            source = sources[index]
        else:
            source = None
    try:
        if not source:
            main.CloseAllDialogs()
            return
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,5000)")
        stream_url = main.resolve_url(source)
        if (stream_url == False):
            return

        if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I):
            mname = mname.split('&')[0]
            infoLabels = main.GETMETAEpiT(mname, thumb, '')
            video_type = 'episode'
            season = infoLabels['season']
            episode = infoLabels['episode']
        else:
            infoLabels = main.GETMETAT(mname, '', '', thumb)
            video_type = 'movie'
            season = ''
            episode = ''
        img = infoLabels['cover_url']
        fanart = infoLabels['backdrop_url']
        imdb_id = infoLabels['imdb_id']
        infolabels = {
            'supports_meta': 'true',
            'video_type': video_type,
            'name': str(infoLabels['title']),
            'imdb_id': str(infoLabels['imdb_id']),
            'season': str(season),
            'episode': str(episode),
            'year': str(infoLabels['year'])
        }

        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        if not video_type is 'episode':
            infoL['originalTitle'] = main.removeColoredText(
                infoLabels['metaName'])
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory(addon_id)
            wh.add_item(mname + ' ' + '[COLOR green]' + prettyName +
                        '[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 8
0
def LINKSP3(mname,murl):
    main.GA("FilesTube","Watched")
    msg = xbmcgui.DialogProgress()
    msg.create('Please Wait!','')
    msg.update(0,'Collecting hosts')
    link=main.OPENURL(murl,mobile=True,timeout = 10)
    sources=[]
    titles=[]
    ok=True
    match=re.compile('(?sim)<pre><span id="copy_paste_links">[^<]+?<').findall(link)
    if match:
        match = re.compile('(https?://[^<]+)').findall(match[0])
    hostsmax = len(match)
    h = 0
    from urlparse import urlparse
    for url in match:
        url = url.strip()
        h += 1
        percent = (h * 100)/hostsmax
        msg.update(percent,'Collecting hosts - ' + str(percent) + '%')
        if msg.iscanceled(): break
        vlink=re.compile('rar|part\d+?(\.html)?$|/folder/').findall(url)
        if len(vlink)==0:
            host = urlparse(url).hostname.replace('www.','').partition('.')[0]
            hostname = host
            host = host.upper()
            quality = mname
            match3=re.compile('(?i)(720p?|1080p?)').findall(quality)
            if match3 and not 'p' in match3[0]: match3[0] += 'p'
            match4=re.compile('mp4').findall(url)
            if len(match3)>0:
                host =host+' [COLOR red]'+match3[0]+'[/COLOR]'
            elif len(match4)>0:
                host =host+' [COLOR green]SD MP4[/COLOR]'
            else:
                host =host+' [COLOR blue]SD[/COLOR]'
            if main.supportedHost(hostname):
                titles.append(host)
                sources.append(url)
    msg.close()
    if (len(sources)==0):
        xbmc.executebuiltin("XBMC.Notification(Sorry!,Could not find a playable link,3000)")
        return
    else:
        dialog = xbmcgui.Dialog()
        index = dialog.select('Choose your stream', titles)
        if index != -1: 
            source = sources[index]
        else: source = None
    try:
        if not source:
            main.CloseAllDialogs()
            return
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)")
        stream_url = main.resolve_url(source)
        if(stream_url == False):
            return
        
        if re.findall('(.+?)\ss(\d+)e(\d+)\s',mname,re.I):
            mname=mname.split('&')[0]
            infoLabels =main.GETMETAEpiT(mname,'','')
            video_type='episode'
            season=infoLabels['season']
            episode=infoLabels['episode']
        else:
            infoLabels =main.GETMETAT(mname,'','','')
            video_type='movie'
            season=''
            episode=''
        img=infoLabels['cover_url']
        fanart =infoLabels['backdrop_url']
        imdb_id=infoLabels['imdb_id']
        infolabels = { 'supports_meta' : 'true', 'video_type':video_type, 'name':str(infoLabels['title']), 'imdb_id':str(infoLabels['imdb_id']), 'season':str(season), 'episode':str(episode), 'year':str(infoLabels['year']) }
        
        infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName']}
        if not video_type is 'episode': infoL['originalTitle']=main.removeColoredText(infoLabels['metaName'])
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']),season=str(season), episode=str(episode), year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname+' '+'[COLOR green]DL4Free[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 9
0
def VIDEOLINKSSG(mname, murl, thumb):
    main.GA("SG", "Watched")
    msg = xbmcgui.DialogProgress()
    msg.create('Please Wait!', '')
    msg.update(0, 'Collecting hosts')
    sources = []
    ok = True
    infoLabels = main.GETMETAEpiT(mname, thumb, '')
    video_type = 'episode'
    season = infoLabels['season']
    episode = infoLabels['episode']
    link = main.OPENURL(murl)
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }
    link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(
        '&nbsp;', '').replace('  ', '')
    match = re.compile(
        'href="([^"]+)"><img src=".+?" /><span class="link_name_tt">([^<]+)</span>'
    ).findall(link)
    hostsmax = len(match)
    h = 0
    import urlresolver
    for url, host in sorted(match):
        host = host.replace('Visit ', '')
        h += 1
        percent = (h * 100) / hostsmax
        msg.update(percent, 'Collecting hosts - ' + str(percent) + '%')
        if (msg.iscanceled()): break
        hosted_media = urlresolver.HostedMediaFile(url=url, title=host)
        sources.append(hosted_media)
    if (len(sources) == 0):
        xbmc.executebuiltin(
            "XBMC.Notification(Sorry!,Show doesn't have playable links,5000)")
        return
    else:
        source = urlresolver.choose_source(sources)
    msg.close()
    try:
        if not source:
            main.CloseAllDialogs()
            return
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,3000)")
        stream_url = main.resolve_url(source.get_url())
        if stream_url == False: return

        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname + ' ' + '[COLOR green]SeriesGate[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 10
0
def PlaySceneLogLink(mname, murl):
    main.GA("SceneLog", "Watched")
    ok = True
    r = re.findall('s(\d+)e(\d\d+)', mname, re.I)
    if r:
        infoLabels = main.GETMETAEpiT(mname, '', '')
        video_type = 'episode'
        season = infoLabels['season']
        episode = infoLabels['episode']
    else:
        infoLabels = main.GETMETAT(mname, '', '', '')
        video_type = 'movie'
        season = ''
        episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }
    playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    playlist.clear()
    try:
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,3000)")
        stream_url = main.resolve_url(murl)
        infoLabels['title'] = main.removeColoredText(infoLabels['title'])
        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        if not video_type is 'episode':
            infoL['originalTitle'] = main.removeColoredText(
                infoLabels['metaName'])
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=infoLabels['title'],
            season=season,
            episode=episode,
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory(addon_id)
            wh.add_item(mname + ' ' + '[COLOR green]SceneLog[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=infoLabels['cover_url'],
                        fanart=infoLabels['backdrop_url'],
                        is_folder=False)
        main.CloseAllDialogs()
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Esempio n. 11
0
def PLAYOCW(mname, murl):
    sources = []
    main.GA("OneclickwatchT", "Watched")
    ok = True
    playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    playlist.clear()
    xbmc.executebuiltin(
        "XBMC.Notification(Please Wait!,Collecting Hosts,5000)")
    link = main.OPENURL(murl)
    link = link.replace('\r',
                        '').replace('\n',
                                    '').replace('\t',
                                                '').replace('&nbsp;', '')

    match = re.compile(
        '<a href="([^"]+?)" rel="nofollow">([^>]+?)</a>').findall(link)
    if len(match) == 0:
        match = re.compile('<a href="(.+?)">(.+?)</a><br />').findall(link)
    desc = re.compile('<.+? />Plot:(.+?)<.+? />').findall(link)
    if len(desc) > 0:
        descs = desc[0]
    else:
        descs = ''
    thumb = re.compile('<img alt="" src="(.+?)"').findall(link)
    if len(thumb) > 0:
        thumbs = thumb[0]
    else:
        thumbs = ''
    main.CloseAllDialogs()
    import urlresolver
    for url, host in match:
        host = re.compile("http://(.+?).com/.+?").findall(url)
        for hname in host:
            host = hname.replace('www.', '')
        hosted_media = urlresolver.HostedMediaFile(url=url, title=host)
        sources.append(hosted_media)

    if (len(sources) == 0):
        xbmc.executebuiltin(
            "XBMC.Notification(Sorry!,Show doesn't have playable links,5000)")
    else:
        source = urlresolver.choose_source(sources)
    try:
        if source:
            xbmc.executebuiltin(
                "XBMC.Notification(Please Wait!,Resolving Link,3000)")
            stream_url = main.resolve_url(source.get_url())
        else:
            stream_url = False
            return
        infoLabels = main.GETMETAEpiT(mname, thumbs, descs)
        video_type = 'episode'
        season = infoLabels['season']
        episode = infoLabels['episode']
        img = infoLabels['cover_url']
        fanart = infoLabels['backdrop_url']
        imdb_id = infoLabels['imdb_id']
        infolabels = {
            'supports_meta': 'true',
            'video_type': video_type,
            'name': str(infoLabels['title']),
            'imdb_id': str(infoLabels['imdb_id']),
            'season': str(season),
            'episode': str(episode),
            'year': str(infoLabels['year'])
        }
        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname + ' ' + '[COLOR green]Oneclickwatch[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels='',
                        img=img,
                        fanart='',
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok