예제 #1
0
def PLAYMEDIA(name,url):
    ok = True
    r = re.findall(r'(.+?)\[COLOR', name)
    name = r[0]
    r=re.findall('Season(.+?)Episode([^<]+)',name)
    if r:
        infoLabels =main.GETMETAEpiT(name,'','')
        video_type='episode'
        season=infoLabels['season']
        episode=infoLabels['episode']
    else:
        infoLabels =main.GETMETAT(name,'','','')
        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']) }
    try:
        stream_url = urlresolver.resolve(url)
        infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
        # play with bookmark
        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":
            wh.add_item(hname+' '+'[COLOR=FF67cc33]TvRelease[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=str(img), fanart=str(fanart), is_folder=False)
        player.KeepAlive()
        return ok
    except:
        return ok
예제 #2
0
def LINKWATCHS(mname,murl):
        main.GA("Watchseries","Watched")
        ok=True
        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.clear()
        match=re.compile('(.+?)xocx(.+?)xocx').findall(murl)
        for hurl, durl in match:
                furl=geturl('http://watchseries.lt'+hurl)
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Checking Link,1500)")
        link=main.OPENURL(durl)
        link=link.replace('\r','').replace('\n','').replace('\t','').replace('&nbsp;','')
        match2=re.compile('<h1 class=".+?"><a href=".+?">.+?</a> - <a href="(.+?)" title=".+?">.+?</a>').findall(link)
        for xurl in match2:
                link2=main.OPENURL('http://watchseries.lt'+xurl)
                link2=link2.replace('\r','').replace('\n','').replace('\t','').replace('&nbsp;','')
        descr=re.compile('<b>Description :</b>(.+?)<').findall(link2)
        if len(descr)>0:
                desc=descr[0]
        else:
                desc=''
        thumbs=re.compile('<td style=".+?"><a href=".+?"><img src="(.+?)"').findall(link2)
        if len(thumbs)>0:
                thumb=thumbs[0]
        else:
                thumb=''
        genres=re.compile('<b>Genre: <a href=.+?>(.+?)</a>').findall(link2)
        if len(genres)>0:
                genre=genres[0]
        else:
                genre=''
        infoLabels =main.GETMETAEpiT(mname,thumb,desc)
        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']) }
        media = urlresolver.HostedMediaFile(furl)
        source = media
        try:
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,4000)")
                        stream_url = source.resolve()
                else:
                        stream_url = False  
                

                infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
                # play with bookmark
                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":
                    wh.add_item(mname+' '+'[COLOR green]WatchSeries[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False)
                player.KeepAlive()
                return ok
        except Exception, e:
                if stream_url != False:
                        main.ErrorReport(e)
                return ok
예제 #3
0
def PLAY(mname,murl,thumb):

        main.GA("Dramania","Watched") 
        ok=True
        
        r = re.findall('(.+?)\ss(\d+)e(\d+)\s',mname,re.I)
        if r:
            infoLabels =main.GETMETAEpiT(mname,'','')
            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']) }
        try :
                xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
                if not video_type is 'episode': infoL['originalTitle']=main.removeColoredText(infoLabels['metaName'])
                from resources.universal import playbackengine
                
                if "'," in murl:
                    mname=main.removeColoredText(mname)
                    pl=xbmc.PlayList(1);pl.clear()
                    playlist = sorted(list(set(eval(murl))), key=lambda playlist: playlist[0])
                    for xname,link in playlist:
                        pl.add(getLink(link),xbmcgui.ListItem(mname+' '+xname,thumbnailImage=img))
                    xbmc.Player().play(pl)
                    while xbmc.Player().isPlaying():
                        xbmc.sleep(2500)
                else:
                    stream_url = getLink(murl)
                    # play with bookmark
                    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]Dramania[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=infoLabels['cover_url'], fanart=infoLabels['backdrop_url'], is_folder=False)
                    player.KeepAlive()
                    return ok
        except Exception, e:
                if stream_url != False:
                        main.ErrorReport(e)
                return ok
예제 #4
0
파일: tubeplus.py 프로젝트: noba3/KoTos
def VIDEOLINKS(mname,url):
        ok=True
        hname=mname
        hname=hname.split('  online')[0]
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Link,3000)")
        r=re.findall('Season(.+?)Episode([^<]+)',mname)
        if r:
            mname=mname.split(' [COLOR blue]')[0]
            infoLabels =main.GETMETAEpiT(mname,'','')
            video_type='episode'
            season=infoLabels['season']
            episode=infoLabels['episode']
        else:
            mname=mname.split(' [COLOR blue]')[0]
            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']) }
        r=re.findall('xoxv(.+?)xoxe(.+?)xoxc',url)
        import urlresolver
        for hoster, url in r:
            source = urlresolver.HostedMediaFile(host=hoster, media_id=url)
        try :
            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 playbackengine, watchhistory
                wh = watchhistory.WatchHistory(addon_id)
                wh.add_item(hname+' '+'[COLOR=FF67cc33]TubePlus[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=str(img), fanart=str(fanart), is_folder=False)
            player.KeepAlive()
            return ok
        except Exception, e:
            if stream_url != False:
                    main.ErrorReport(e)
            return ok     
예제 #5
0
def iWatchLINKB(mname,url):
        main.GA("iWatchonline","Watched")
        ok=True
        hname=mname
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Link,3000)")
        mname=mname.split('   [COLOR red]')[0]
        r=re.findall('Season(.+?)Episode([^<]+)',mname)
        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']) }
        link=main.OPENURL(url)
        link=main.unescapes(link)
        match=re.compile('<(?:iframe|pagespeed_iframe).+?src=\"(.+?)\"').findall(link)
        hosted_media = urlresolver.HostedMediaFile(match[0])
        source=hosted_media
        try :
            if source:
                    xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                    stream_url = source.resolve()
            else:
                    stream_url = False
                    return
                
            infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
            # play with bookmark
            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":
                wh.add_item(hname+' '+'[COLOR green]iWatchonline[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=str(img), fanart=str(fanart), is_folder=False)
            player.KeepAlive()
            return ok
        except Exception, e:
            if stream_url != False:
                    main.ErrorReport(e)
            return ok
예제 #6
0
def LINKSP2B(mname,murl):
        main.GA("Newmyvideolinks","Watched") 
        ok=True
        r = re.findall('(.+?)\ss(\d+)e(\d+)\s',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()
        hosted_media = urlresolver.HostedMediaFile(murl)
        source = hosted_media
        try :
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                        stream_url = source.resolve()
                else:
                      stream_url = False
                infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
                # play with bookmark
                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":
                    wh.add_item(mname+' '+'[COLOR green]NewmyVideoLink[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=infoLabels['cover_url'], fanart=infoLabels['backdrop_url'], is_folder=False)
                player.KeepAlive()
                return ok
        except Exception, e:
                if stream_url != False:
                        main.ErrorReport(e)
                return ok
예제 #7
0
def PLAYPFTV(mname,murl):
    host=murl.split('x1x8x')[0]
    media_id=murl.split('x1x8x')[1]
    main.GA(prettyName,"Watched")
    ok=True
    xbmc.executebuiltin("XBMC.Notification(Please Wait!,Checking Link,3000)")
    #furl=geturl(murl)
    infoLabels =main.GETMETAEpiT(mname,'','')
    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']) }
    try:
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
        
        import urlresolver
        source = urlresolver.HostedMediaFile(host=host, media_id=media_id)
        if source:
                stream_url = source.resolve()
        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]PFTV[/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
예제 #8
0
def LINKFULLS(name,murl):
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
        main.GA("fullstream","Watched")
        stream_url = False
        ok=True
        r = re.findall('Season(.+?)Episode([^<]+)',name)
        if r:
            infoLabels =main.GETMETAEpiT(name,'','')
            video_type='episode'
            season=infoLabels['season']
            episode=infoLabels['episode']
        else:
            infoLabels =main.GETMETAT(name,'','','')
            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:
                    listitem = xbmcgui.ListItem(thumbnailImage=img)
                    listitem.setInfo('video', {'Title': name, 'Year': ''} )         
                
                    infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
                    # play with bookmark
                    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":
                        wh.add_item(name+' '+'[COLOR green]Peliculaspepito[/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
예제 #9
0
def PLAYBTV(mname,murl):
        furl=GETLINKBTV(murl)
        ok=True
        if furl=='':
                return ok
        else:
                infoLabels =main.GETMETAEpiT(mname,'','')
                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']) }
                media = urlresolver.HostedMediaFile(furl)
                source = media
                try:
                    if source:
                            xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                            stream_url = source.resolve()
                    else:
                            stream_url = False
                    

                    infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
                    # play with bookmark
                    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":
                        wh.add_item(mname+' '+'[COLOR green]BTV[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart='', is_folder=False)
                    player.KeepAlive()
                    return ok
                except Exception, e:
                        if stream_url != False:
                                main.ErrorReport(e)
                        return ok
예제 #10
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
예제 #11
0
def VIDEOLINKSSG(mname, murl, thumb):
    main.GA("SG", "Watched")
    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'])
    }
    xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting hosts,500)")
    link = link.replace('\r',
                        '').replace('\n',
                                    '').replace('\t',
                                                '').replace('&nbsp;', '')
    match = re.compile('href="([^<]+)" TARGET=".+?" >([^<]+)</a>').findall(
        link)
    for url, host in sorted(match):
        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,5000)")
            stream_url = source.resolve()
        else:
            stream_url = False
            return

        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        # play with bookmark
        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":
            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
예제 #12
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
예제 #13
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
예제 #14
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
예제 #15
0
파일: sceper.py 프로젝트: the-one-/MashUp
def VIDEOLINKSSCEPER(mname, murl, thumb):
    main.GA("Sceper", "Watched")
    link = main.OPENURL(murl)
    sources = []
    ok = True
    playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    playlist.clear()
    xbmc.executebuiltin(
        "XBMC.Notification(Please Wait!,Collecting hosts,3000)")
    match = re.compile('<a href="([^<]+)">htt').findall(link)
    for url in match:
        print url
        vlink = re.compile('rar').findall(url)
        if len(vlink) == 0:
            match2 = re.compile('http://(.+?)/.+?').findall(url)
            for host in sorted(match2):
                host = host.replace('www.', '')
                match3 = re.compile('720p').findall(url)
                match4 = re.compile('mp4').findall(url)
                if len(match3) > 0:
                    host = host + ' [COLOR red]HD[/COLOR]'
                elif len(match4) > 0:
                    host = host + ' [COLOR green]SD MP4[/COLOR]'
                else:
                    host = host + ' [COLOR blue]SD[/COLOR]'

                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!,Link is being Resolved,5000)")
            stream_url = source.resolve()
        else:
            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']
        }
        # play with bookmark
        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":
            wh.add_item(mname + ' ' + '[COLOR green]Sceper[/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
예제 #16
0
def MLink(mname, murl, thumb):
    main.GA(mname, "Watched")
    ok = True
    xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Link,5000)")
    if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I) or re.findall(
            'Season(.+?)Episode([^<]+)', mname, re.I):
        infoLabels = main.GETMETAEpiT(mname, thumb, '')
        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'])
    }
    try:
        stream_url = main.resolve_url(murl)
        if stream_url == False:
            return
        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre'],
            'originaltitle': infoLabels['metaName']
        }
        # play with bookmark
        stream_url = stream_url.replace(' ', '%20')
        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]VIPlaylist[/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
예제 #17
0
def PlayDirectDownloadTVLink(mname, murl):
    main.GA("DirectDownloadTV", "Watched")
    ok = True
    infoLabels = main.GETMETAEpiT(mname, '', '')
    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'])
    }
    try:
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,3000)")
        stream_url = main.resolve_url(murl)

        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre'],
            'originaltitle': 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=str(season),
            episode=(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        if stream_url: main.CloseAllDialogs()
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from resources.universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.movie25')
            wh.add_item(mname + ' ' + '[COLOR green]Rlsmix[/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
예제 #18
0
def LINKSP2B(mname, murl):
    main.GA("Newmyvideolinks", "Watched")
    ok = True
    r = re.findall('(.+?)\ss(\d+)e(\d+)\s', 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)")
        parts = murl.partition('#@#')
        murl = parts[0]
        filename = parts[-1]
        stream_url = main.resolve_url(murl, filename)
        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=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]NewmyVideoLink[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=infoLabels['cover_url'],
                        fanart=infoLabels['backdrop_url'],
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
예제 #19
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('<p><a href=".+?" rel=".+?">(.+?)</a></p>').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 = ''
    for url 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 = source.resolve()
        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']
        }
        # play with bookmark
        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":
            wh.add_item(mname + ' ' + '[COLOR green]Oneclickwatch[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except:
        return ok
예제 #20
0
파일: backuptv.py 프로젝트: the-one-/MashUp
def CHANNELCLink(mname, murl):
    main.GA("CC/Tv4", "Watched")
    sources = []
    xbmc.executebuiltin(
        "XBMC.Notification(Please Wait!,Collecting hosts,3000)")
    link = main.OPENURL(murl)
    ok = True
    playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    playlist.clear()
    site = re.findall('channelcut', murl)
    if len(site) > 0:
        match = re.compile('<p><a href="(.+?)" rel=".+?">.+?</a></p>').findall(
            link)
    else:
        match = re.compile('<td><a href="(.+?)" target="').findall(link)
    for url in match:
        match2 = re.compile('http://(.+?)/.+?').findall(url)
        for host in match2:
            host = host.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,5000)")
            stream_url = source.resolve()
        else:
            stream_url = False
            return
        infoLabels = main.GETMETAEpiT(mname, '', '')
        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']
        }
        # play with bookmark
        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":
            wh.add_item(mname + ' ' + '[COLOR green]CC/Tv4[/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
예제 #21
0
def PLAY(mname, murl, thumb):
    main.GA("MBox", "Watched")
    stream_url = resolveMBLink(murl)
    r = re.findall('(.+?)\sSeason\s(\d+)\sEpisode\s(\d+)', mname, re.I)
    if r:
        infoLabels = main.GETMETAEpiT(mname, '', '')
        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'])
    }
    try:
        if stream_url == False: return
        infoL = {
            'Title': infoLabels['title'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre'],
            'originaltitle': infoLabels['metaName']
        }
        # play with bookmark
        stream_url = stream_url.replace(' ', '%20')
        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]MBOX[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return True
    except Exception, e:
        if stream_url != False: main.ErrorReport(e)
        return False
예제 #22
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
예제 #23
0
파일: movie1k.py 프로젝트: rjt2/Kasiks-Repo
def VIDEOLINKST2(mname, murl, thumb):
    sources = []
    main.GA("Movie1k", "Watched")
    xbmc.executebuiltin(
        "XBMC.Notification(Please Wait!,Collecting Hosts,10000)")
    f = re.findall('(.+?) Season (.+?) Episode ([^<]+)', mname, re.I)
    if f:
        infoLabels = main.GETMETAEpiT(mname, thumb, '')
        video_type = 'episode'
        season = infoLabels['season']
        episode = infoLabels['episode']
    if len(f) == 0:
        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'])
    }
    link = main.OPENURL(murl)
    link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(
        '&nbsp;', '').replace('<td>', '<td >')
    ok = True
    match = re.compile(
        '<td >.+?</td><td >([^"]*)</td><td.+?><a.+?href="http://www.movie1k.ag/watch.php[?]idl=(.+?)" target',
        re.DOTALL).findall(link)

    for host, url in match:
        print "im in"
        if 'movie1k' in url:
            matchx = re.compile('movie1k').findall(url)
            if len(matchx) == 0:
                hosted_media = urlresolver.HostedMediaFile(url=url, title=host)
                sources.append(hosted_media)
            match3 = re.compile('movie1k').findall(url)
            if len(match3) > 0:
                link2 = main.OPENURL(url)
                link2 = link2.replace('\r', '').replace('\n', '').replace(
                    '\t', '').replace('&nbsp;', '')
                match4 = re.compile('<iframe.+?src="(.+?)"').findall(link2)
                if len(match4) == 0:
                    match4 = re.compile('<IFRAME SRC="(.+?)"').findall(link2)
                    if len(match4) == 0:
                        match4 = re.compile("src='(.+?)'").findall(link2)
                for url in match4:
                    matchx = re.compile('movie1k').findall(url)
                    if len(matchx) == 0:
                        hosted_media = urlresolver.HostedMediaFile(url=url,
                                                                   title=host)
                        sources.append(hosted_media)
        else:
            matchx = re.compile('movie1k').findall(url)
            if len(matchx) == 0:
                hosted_media = urlresolver.HostedMediaFile(url=url, title=host)
                sources.append(hosted_media)

    match2 = re.compile(
        '<td >.+?</td><td >(.+?)</td><td ><a.+?href="http://www.linkembed.net/watch.php[?]idl=(.+?)" target',
        re.DOTALL).findall(link)

    for host, url in match2:
        print "im in"
        if 'linkembed' in url:
            matchxa = re.compile('linkembed').findall(url)
            if len(matchxa) == 0:
                hosted_media = urlresolver.HostedMediaFile(url=url, title=host)
                sources.append(hosted_media)
            match3a = re.compile('linkembed').findall(url)
            if len(match3a) > 0:
                link2 = main.OPENURL(url)
                link2 = link2.replace('\r', '').replace('\n', '').replace(
                    '\t', '').replace('&nbsp;', '')
                match4a = re.compile('<iframe.+?src="(.+?)"').findall(link2)
                if len(match4a) == 0:
                    match4a = re.compile('<IFRAME SRC="(.+?)"').findall(link2)
                    if len(match4a) == 0:
                        match4a = re.compile("src='(.+?)'").findall(link2)
                for url in match4a:
                    matchx = re.compile('linkembed').findall(url)
                    if len(matchxa) == 0:
                        hosted_media = urlresolver.HostedMediaFile(url=url,
                                                                   title=host)
                        sources.append(hosted_media)
        else:
            matchxb = re.compile('linkembed').findall(url)
            if len(matchxb) == 0:
                hosted_media = urlresolver.HostedMediaFile(url=url, title=host)
                sources.append(hosted_media)

    try:
        if (len(sources) == 0):
            xbmc.executebuiltin(
                "XBMC.Notification(Sorry!,Show doesn't have playable links,5000)"
            )

        else:
            source = urlresolver.choose_source(sources)
            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
            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":
                wh.add_item(mname + ' ' + '[COLOR green]Movie1k[/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