• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python urlresolver.choose_source函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中urlresolver.choose_source函数的典型用法代码示例。如果您正苦于以下问题:Python choose_source函数的具体用法?Python choose_source怎么用?Python choose_source使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了choose_source函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: LINKSP3

def LINKSP3(mname, url):
    main.GA("Dailyfix", "Watched")
    sources = []
    ok = True
    link = main.OPENURL(url)
    match = re.compile("<a href='(.+?)' class='.+?' title='.+?' rel='.+?'>.+?</a").findall(link)
    for murl in match:
        host = re.compile("http://(.+?).com/.+?").findall(murl)
        for hname in host:
            hname = hname.replace("www.", "")
            hosted_media = urlresolver.HostedMediaFile(url=murl, title=hname)
            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)
        if source:
            xbmc.executebuiltin("XBMC.Notification(Please Wait!,Actual HD Movie Requires Buffer Time,7000)")
            stream_url = source.resolve()
        else:
            stream_url = False
            return
        listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
        listitem.setInfo("video", {"Title": mname, "Year": ""})

        xbmc.Player().play(stream_url, listitem)
        return ok
开发者ID:nadav1110,项目名称:mash2k3-repository,代码行数:28,代码来源:dailyflix.py


示例2: VIDEOLINKSSG

def VIDEOLINKSSG(mname,murl):
        main.GA("SG","Watched")
        sources = []
        ok=True
        link=main.OPENURL(murl)
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting hosts,5000)")
        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)
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)")
                        stream_url = source.resolve()
                else:
                      stream_url = False
                      return
                listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': mname, 'Year': ''} )       
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:Segfaulter,项目名称:mash2k3-repository,代码行数:26,代码来源:seriesgate.py


示例3: VIDEOLINKST

def VIDEOLINKST(mname,url):
        main.GA("iWatchonline","Watched")
        Mainurl ='http://www.iwatchonline.org'
        url=Mainurl+url
        sources = []
        ok=True
        match=re.compile('http://www.iwatchonline.org/episode/(.+?)-.+?').findall(url)
        for movieid in match:
                url=url + '?tmpl=component&option=com_jacomment&view=comments%20&contentoption=com_content&contentid='+ movieid
        link=main.OPENURL(url)
        match=re.compile('<a href="(.+?)" target="_BLANK" class="vidLinks">(.+?)</a>').findall(link)
        for url, name in match:
                hosted_media = urlresolver.HostedMediaFile(url=url, title=name)
                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)
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                        stream_url = source.resolve()
                else:
                        stream_url = False
                        return
                listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': mname, 'Year': ''} )         
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:Segfaulter,项目名称:mash2k3-repository,代码行数:29,代码来源:iwatchonline.py


示例4: LINK

def LINK(mname,murl):
        main.GA("dubzonline-"+mname,"Watched")
        sources = []
        ok=True
        link=main.OPENURL(murl)
        link=link.replace('\r','').replace('\n','').replace('\t','').replace('&nbsp;','')
        match = re.compile('''<span class='.+?'><b>.+?</b></span><iframe src="(.+?)"''').findall(link)
        for url in match:
                match2=re.compile('http://(.+?)/.+?').findall(url)
                for host in match2:
                    host = host.replace('www.','')
                    if host =='putlocker.com' or host =='sockshare.com':
                                url=url.replace('embed','file')
                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)
                if source:
                        stream_url = source.resolve()
                else:
                      stream_url = False
                      return
                listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': mname, 'Year': ''} )       
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:Segfaulter,项目名称:mash2k3-repository,代码行数:29,代码来源:dubzonline.py


示例5: CHANNELCLink

def CHANNELCLink(mname,murl):
        main.GA("ChannelCut","Watched")
        sources = []
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting hosts,3000)")
        link=main.OPENURL(murl)
        ok=True
        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)
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)")
                        stream_url = source.resolve()
                else:
                      stream_url = False
                      return
                listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': mname, 'Year': ''} )       
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:Segfaulter,项目名称:mash2k3-repository,代码行数:32,代码来源:backuptv.py


示例6: play_video

def play_video(siteid, cls, epid, partnum):
    siteid = int(siteid)
    api = BaseForum.__subclasses__()[siteid]()

    part_media = plugin.request.args['media'][0]
    media = []

    import urlresolver
    for host, vid in sorted(part_media, key=lambda x: x[0].server):
        r = urlresolver.HostedMediaFile(
            host=host.server, media_id=vid)
        if r:
            media.append(r)

    source = urlresolver.choose_source(media)
    plugin.log.debug('>>> Source selected')
    plugin.log.debug(source)

    if source:
        url = source.resolve()

        if not __is_resolved(url):
            msg = str(url.msg)
            raise Exception(msg)

        else:
            plugin.log.debug('play video: {url}'.format(url=url))
            plugin.set_resolved_url(url)        
        
    else:
        msg = [_('cannot_play'), _('choose_source')]
        plugin.log.error(msg[0])
        dialog = xbmcgui.Dialog()
        dialog.ok(api.long_name, *msg)
开发者ID:RozebMomin,项目名称:KodiAddons,代码行数:34,代码来源:addon.py


示例7: LINKFMA

def LINKFMA(mname,murl):
        main.GA("FMA","Watched")
        sources = []
        ok=True
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting hosts,3000)")
        link=main.OPENURL(murl)
        link=link.replace('\r','').replace('\n','').replace('\t','').replace('&nbsp;','')
        desc=re.compile('<meta name="description" content="(.+?)"').findall(link)
        match=re.compile('<span class=\'.+?\'>(.+?)</span></p><div class=\'.+?\'><img src=\'(.+?)\' /></div><a class=\'.+?\' href="(.+?)"').findall(link)
        for host, thumb, url in match:
                durl='http://www.freemoviesaddict.com/'+url
                redirect=main.REDIRECT(durl)
                print "fff "+redirect
                hosted_media = urlresolver.HostedMediaFile(url=redirect, 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)
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving links,3000)")
                        stream_url = source.resolve()
                else:
                      stream_url = False
                      return
                listitem = xbmcgui.ListItem(mname, thumbnailImage= thumb)
                listitem.setInfo('video', {'Title': mname, 'Plot': desc[0]} )       
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:Segfaulter,项目名称:mash2k3-repository,代码行数:31,代码来源:fma.py


示例8: PlayUrlSource

def PlayUrlSource(url,name):
 try:
    GA("PlayVideo",name)
    xbmc.executebuiltin("XBMC.Notification(if this mirror is a trailer,try another mirror,5000)")
    match=re.compile('(youtu\.be\/|youtube-nocookie\.com\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v|user)\/))([^\?&"\'>]+)').findall(url)
    if(len(match) > 0):
        lastmatch = match[0][len(match[0])-1].replace('v/','')
        playVideo('youtube',lastmatch)
        url1 = 'plugin://plugin.video.youtube?path=/root/video&action=play_video&videoid=' + lastmatch.replace('?','')
        liz = xbmcgui.ListItem('[B]PLAY VIDEO[/B]', thumbnailImage="")
        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.add(url=url1, listitem=liz)
    else:
        sources = []
        #try:
        label=name
        hosted_media = urlresolver.HostedMediaFile(url=url, title=label)
        sources.append(hosted_media)
        #except:
        print 'Error while trying to resolve %s' % url

        source = urlresolver.choose_source(sources)
        print "source info=" + str(source)
        if source:
                stream_url = source.resolve()
                print 'Attempting to play url: %s' % stream_url
                playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
                playlist.clear()
                listitem = xbmcgui.ListItem(label, iconImage="", thumbnailImage="")
                playlist.add(url=stream_url, listitem=listitem)
                xbmc.Player().play(playlist)
 except: pass 
开发者ID:ak0ng,项目名称:dk-xbmc-repaddon-rep,代码行数:32,代码来源:default.py


示例9: VIDEOLINKST3

def VIDEOLINKST3(mname,murl):
        sources = []
        main.GA("OneclickwatchT","Watched")
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting Hosts,5000)")
        link=main.OPENURL(murl)
        ok=True
        match=re.compile('<a href="(.+?)">(.+?)</a><br />').findall(link)
        for url, host in 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)
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                        stream_url = source.resolve()
                else:
                        stream_url = False
                        return
                listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': mname, 'Year': ''} )         
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:nadav1110,项目名称:mash2k3-repository,代码行数:27,代码来源:oneclickwatch.py


示例10: loadVideos

def loadVideos(url,name):
                xbmc.executebuiltin("XBMC.Notification(Please Wait!,Loading selected video)")
                link=GetContent(url)
                link = ''.join(link.splitlines()).replace('\t','').replace('\'','"')
        #try:
                newlink = re.compile('"setMedia", {(.+?):"(.+?)"').findall(link)
                if(len(newlink) > 0):
                        (vtmp1,vlink)=newlink[0]
                else:
                        newlink = re.compile('<iframe [^>]*src=["\']?([^>^"^\']+)["\']?[^>]*>').findall(link)
                        vlink=newlink[0]
                match=re.compile('(youtu\.be\/|youtube-nocookie\.com\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v|user)\/))([^\?&"\'>]+)').findall(vlink)
                if(len(match) > 0):
                        lastmatch = match[0][len(match[0])-1].replace('v/','')
                        playVideo('youtube',lastmatch)
                elif (vlink.find("vimeo") > -1):
                        print "newlink|" + vlink
                        idmatch =re.compile("http://player.vimeo.com/video/([^\?&\"\'>]+)").findall(vlink)
                        if(len(idmatch) > 0):
                             playVideo('vimeo',idmatch[0])
                else:
                        sources = []
                        label=name
                        hosted_media = urlresolver.HostedMediaFile(url=vlink, title=label)
                        sources.append(hosted_media)
                        source = urlresolver.choose_source(sources)
            
                        if source:
                              print "in source"
                              vidlink = source.resolve()
                        else:
                              vidlink =vlink
                        print "vidlink" + vidlink
                        playVideo('khmerportal',urllib2.unquote(vidlink).decode("utf8"))
开发者ID:ak0ng,项目名称:dk-xbmc-repaddon-rep,代码行数:34,代码来源:default.py


示例11: LINKINT3

def LINKINT3(name,murl):
        sources = []
        main.GA("Cinevip","Watched")
        link=main.OPENURL(murl)
        ok=True
        match=re.compile('<span class=".+?">(.+?)</span></td>\n<td>(.+?)</td>\n<td>.+?</td>\n<td>.+?href=http://adf.ly/.+?/(.+?)>').findall(link)
        if len(match) == 0:
                match=re.compile('<span class=".+?">(.+?)</span></td>\n<td>(.+?)</td>\n<td>.+?</td>\n<td>.+?href="http://adf.ly/.+?/(.+?)"').findall(link)
        for host, lang, url in match:
                print url
                hosted_media = urlresolver.HostedMediaFile(url=url, title=host+' [COLOR red]'+lang+'[/COLOR]')
                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)
                if source:
                        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
                        stream_url = source.resolve()
                        if source.resolve()==False:
                                xbmc.executebuiltin("XBMC.Notification(Sorry!,Link Cannot Be Resolved,5000)")
                                return
                else:
                        stream_url = False
                        return
                listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': name, 'Year': ''} )         
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:nadav1110,项目名称:mash2k3-repository,代码行数:30,代码来源:cinevip.py


示例12: LINKSP4

def LINKSP4(mname, murl):
    sources = []
    main.GA("Oneclickmovies", "Watched")
    link = main.OPENURL(murl)
    ok = True
    link = link.replace('href="http://oneclickmoviez.com/dws/MEGA', "")
    match = re.compile('<a href="(.+?)" target="_blank">(.+?)</a>.+?</p>').findall(link)
    for url, host in match:
        vlink = getlink(url)
        match2 = re.compile("rar").findall(vlink)
        if len(match2) == 0:
            hosted_media = urlresolver.HostedMediaFile(url=vlink, 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)
        if source:
            xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
            stream_url = source.resolve()
        else:
            stream_url = False
            return
        listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
        listitem.setInfo("video", {"Title": mname, "Year": ""})
        xbmc.Player().play(stream_url, listitem)
        return ok
开发者ID:nadav1110,项目名称:mash2k3-repository,代码行数:28,代码来源:oneclickmoviez.py


示例13: request_servidores

def request_servidores(url,name):
    titles=[]; ligacao=[]
    link=abrir_url(url)
    recolha=re.compile('----- (.+?) ---- (.+?) ---').findall(link)
    for titulo, endereco in recolha:
        titles.append(titulo)
        ligacao.append(endereco)
    if len(ligacao)==1: index=0
    elif len(ligacao)==0: ok=mensagemok('Gato Fedorento', 'Nenhum stream disponivel.'); return     
    else: index = menuescolha('Escolha a parte', titles)
    if index > -1:
        linkescolha=ligacao[index]
        if linkescolha:
            import urlresolver
            sources=[]
            hosted_media = urlresolver.HostedMediaFile(url=linkescolha)
            sources.append(hosted_media)
            source = urlresolver.choose_source(sources)
            if source:
                linkescolha=source.resolve()
                if linkescolha==False:
                    okcheck = xbmcgui.Dialog().ok
                    okcheck(traducao(40000),traducao(40019))
                    return
                comecarvideo(linkescolha,name)
开发者ID:Thewallguy,项目名称:fightnight-addons,代码行数:25,代码来源:default.py


示例14: getVideoUrl

def getVideoUrl(url,name):
   #data = json.load(urllib2.urlopen(url))['streams']
   #for i, item in enumerate(data):
        if(url.find("dailymotion") > -1):
                dailylink = url+"&dk;"
                match=re.compile('www.dailymotion.pl/video/(.+?)-').findall(dailylink)
                if(len(match) == 0):
                        match=re.compile('/video/(.+?)&dk;').findall(dailylink)
                link = 'http://www.dailymotion.com/video/'+str(match[0])
                vidlink=getDailyMotionUrl(str(match[0]))
        elif(url.find("google") > -1):
            vidcontent=GetContent(url)
            vidmatch=re.compile('"application/x-shockwave-flash"\},\{"url":"(.+?)",(.+?),(.+?),"type":"video/mpeg4"\}').findall(vidcontent)
            vidlink=vidmatch[0][0]
        elif(url.find("youtube") > -1):
            vidmatch=re.compile('(youtu\.be\/|youtube-nocookie\.com\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v|user)\/))([^\?&"\'>]+)').findall(url)
            vidlink=vidmatch[0][len(vidmatch[0])-1].replace('v/','')
            vidlink='plugin://plugin.video.youtube?path=/root/video&action=play_video&videoid='+vidlink
        else:
            sources = []
            label=name
            hosted_media = urlresolver.HostedMediaFile(url=url, title=label)
            sources.append(hosted_media)
            source = urlresolver.choose_source(sources)
            print "urlrsolving" + url
            if source:
                vidlink = source.resolve()
            else:
                vidlink =""
        return vidlink
开发者ID:polturgiest,项目名称:dk-xbmc-repaddon-rep,代码行数:30,代码来源:default.py


示例15: VIDEOLINKSEXTRA

def VIDEOLINKSEXTRA(mname,murl):
        main.GA("Extramina","Watched")
        sources = []
        link=main.OPENURL(murl)
        ok=True
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting hosts,5000)")
        match=re.compile('<div class="streamlink"><a target=".+?" href="http://adf.ly/.+?/(.+?)">(.+?)</a></div>').findall(link)
        for url, host in match:
                match3=re.compile('extraminamovies').findall(url)
                if len(match3)>0:
                    link2=main.OPENURL(url)
                    match = re.compile('<iframe src="(.+?)"').findall(link2)
                    for url in match:
                        match2=re.compile('http://(.+?)/.+?').findall(url)
                        for host in match2:
                            host = host.replace('www.','')
                            if host =='putlocker.com':
                                url=url.replace('embed','file')
                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)
                if source:
                        stream_url = source.resolve()
                else:
                      stream_url = False
                      return
                listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
                listitem.setInfo('video', {'Title': mname, 'Year': ''} )       
                xbmc.Player().play(stream_url, listitem)
                return ok
开发者ID:Segfaulter,项目名称:mash2k3-repository,代码行数:34,代码来源:extramina.py


示例16: LINKSP2

def LINKSP2(mname, url):
    main.GA("Newmyvideolinks", "Watched")
    sources = []
    ok = True
    link = main.OPENURL(url)
    link = link.replace("http://go.etowns.net", "")
    match = re.compile('<li><a href="h(.+?)">(.+?)</a></li>').findall(link)
    for murl, name in match:
        murl = "h" + murl
        hosted_media = urlresolver.HostedMediaFile(url=murl, title=name)
        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(reversed(sources))
        if source:
            xbmc.executebuiltin("XBMC.Notification(Please Wait!,Actual HD Movie Requires Buffer Time,7000)")
            stream_url = source.resolve()
        else:
            stream_url = False
            return
        listitem = xbmcgui.ListItem(mname, iconImage="DefaultVideo.png")
        listitem.setInfo("video", {"Title": mname, "Year": ""})

        xbmc.Player().play(stream_url, listitem)
        return ok
开发者ID:nadav1110,项目名称:mash2k3-repository,代码行数:27,代码来源:newmyvideolinks.py


示例17: VIDEOLINKST3

def VIDEOLINKST3(mname,murl):
        sources=[]
        main.GA("OneclickwatchM","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('<br /><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=''
        for url,host in match:
                print url
                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
                print stream_url
                infoLabels =main.GETMETAT(mname,'','',thumbs)
                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]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
开发者ID:the-one-,项目名称:MashUp,代码行数:59,代码来源:oneclickwatch.py


示例18: GetLinks

def GetLinks(section, url): # Get Links
        print 'GETLINKS FROM URL: '+url
        html = net.http_GET(str(url)).content
        CLEAN(html)
        sources = []
        listitem = GetMediaInfo(html)
        print 'LISTITEM: '+str(listitem)
        content = html
        print'CONTENT: '+str(listitem)
        r = re.search('<strong>Links.*</strong>', html)
        if r:
                content = content[:r.start()]

        match = re.compile('href="(.+?)"').findall(content)
        listitem = GetMediaInfo(content)
        for url in match:
                host = GetDomain(url)

                if 'Unknown' in host:
                                continue

                # ignore .rar files
                r = re.search('\part1\part2\part3\part4\part5\.rar.html\.rar\.file[(?:\.html|\.htm)]*', url, re.IGNORECASE)
                if r:
                        continue

                print '*****************************' + host + ' : ' + url
                title = url.rpartition('/')
                title = title[2].replace('.html', '')
                title = title.replace('.htm', '')
                title = title.replace('file', '[COLOR red][B][I]RAR no streaming[/B][/I][/COLOR]')
                title = title.replace('.rar', '[COLOR red][B][I]RAR no streaming[/B][/I][/COLOR]')
                title = title.replace('www.', '')
                title = title.replace ('-','')
                title = title.replace('_',' ')
                title = title.replace('gaz','')
                title = title.replace('NTb','')
                title = title.replace('part1','')
                title = title.replace('part2','')
                title = title.replace('part3','')
                title = title.replace('part4','')
                title = title.replace('part5','')
                title = title.replace('.',' ')
                title = title.replace('720p','[COLOR gold][B][I]720p[/B][/I][/COLOR]')
                title = title.replace('1080p','[COLOR orange][B][I]1080p[/B][/I][/COLOR]')
                title = title.replace('DDLValley eu','')
                title = title.replace('mkv','[COLOR gold][B][I]MKV[/B][/I][/COLOR] ')
                title = title.replace('avi','[COLOR pink][B][I]AVI[/B][/I][/COLOR] ')
                title = title.replace('mp4','[COLOR purple][B][I]MP4[/B][/I][/COLOR] ')
                name = host+'-'+title
                hosted_media = urlresolver.HostedMediaFile(url=url, title=name)
                sources.append(hosted_media)


        source = urlresolver.choose_source(sources)
        if source: stream_url = source.resolve()
        else: stream_url = ''
        xbmc.Player().play(stream_url)
开发者ID:shmeliuga,项目名称:My-Repo,代码行数:58,代码来源:default.py


示例19: VIDEOLINKSSG

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
开发者ID:alejusar,项目名称:starthere,代码行数:58,代码来源:seriesgate.py


示例20: loadVideos

def loadVideos(url,name):
        #try:
           print 'url in loadVideos: ' + url
           GA("LoadVideo",name)
           #urlLink = url.split("++")
           #print urlLink
           #xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
           xbmc.executebuiltin("XBMC.Notification(Xin Vui lòng chờ!, Đang tải phim,2000)")
           newlink = ''
           if(url.find("redirector.googlevideo.com") > 0 or url.find("ad.dailysach.net") > 0 or url.find("117.103.204.132") > 0):
               playVideo('direct',url)
           else:
               link = GetContentMob(url)
               #print 'link in loadvideo' + url + name + link 
           
               match=re.compile('<script src=\'(.+?)\'></script><div id=\'ooyalaplayer\' style=\'width:640px;height:264px;max-width:100%\'></div>').findall(link)
               if(len(match) == 0):
                   match=re.compile('<iframe width="640" height="270" style="max-width:100%;" src="(.+?)" frameborder="0" allowfullscreen></iframe>').findall(link)
                   if(len(match) == 0):
                       match=re.compile('<iframe width="640" height="389" style="max-width:100%;" src="(.+?)" frameborder="0" allowfullscreen></iframe>').findall(link)              
                       if(len(match) == 0):
                           match=re.compile('<source src="(.+?)" type="video/mp4">').findall(link)
               newlink = match[0]
               print newlink
           #newlink = 'http://ad.dailysach.net/mb/mp4/vkool999epeIp2ivi71kvaWVaKeiimyOqtRivLnhqMOAfmiRf3ZwkHmPZpB7p2iMgnttj3GnlJKzuW3In-Jkm7qJhM6To27Dm5egzL_lmcK_h6m7xKOgyK7KnM-O7GqQh3hqi392dJB6i2ePfqFjj4d4ZQ==/video/ZGZ4ZGp2ZQH4ZN==-480.mp4'
               if(newlink == '' or newlink.find("player.ooyala.com") > 0):
                   d = xbmcgui.Dialog()
                   d.ok('Not Implemented','No playable streams found','Please choose different server!!!')
               elif(newlink.find("zing") > 0):
                   playVideo("direct",newlink)
               else:
                   sources = []
                   label=name
                   hosted_media = ""
                   if(newlink.find("youtube") > 0):
                       lastmatch=""
                       match=re.compile('(youtu\.be\/|youtube-nocookie\.com\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v|user)\/))([^\?&"\'>]+)').findall(newlink)
                       #IF MATCH
                       if(len(match) > 0):
                           lastmatch = match[0][len(match[0])-1].replace('v/','')
                       #IF ID FOUND
                       if(len(lastmatch) > 0):
                           print lastmatch
                           hosted_media = urlresolver.HostedMediaFile(url='http://youtube.com/watch?v='+lastmatch, title='youtube')
                       else:
                           d = xbmcgui.Dialog()
                           d.ok('Not Implemented','No playable streams found','Please choose different server!!!')
                           return
                   else:        
                       hosted_media = urlresolver.HostedMediaFile(url=newlink, title=label)
                   sources.append(hosted_media)
                   source = urlresolver.choose_source(sources)
                   #print "urlrsolving" + newlink
                   if source:
                       vidlink = source.resolve()
                   else:
                       vidlink =""
                   playVideo("direct",vidlink)
开发者ID:kanalei2002,项目名称:viettv247-xbmc-addons,代码行数:58

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python urlresolver.display_settings函数代码示例发布时间:2022-05-27
下一篇:
Python urlparser.urlparser函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap