当前位置: 首页>>代码示例>>Python>>正文


Python YDStreamExtractor类代码示例

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


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

示例1: download_video

    def download_video(self):
        selection = xbmcgui.Dialog().select(heading=LANG(22080), list=[LANG(33003)])
        if selection == 0:
            import YDStreamExtractor

            vid = YDStreamExtractor.getVideoInfo(self.listitem.getProperty("youtube_id"), quality=1)
            YDStreamExtractor.handleDownload(vid)
开发者ID:teamThevibe,项目名称:script.extendedinfo,代码行数:7,代码来源:DialogBaseInfo.py

示例2: showVideo

def showVideo(url):
    if url:
        import YDStreamExtractor
        YDStreamExtractor.disableDASHVideo(True)

        vid = YDStreamExtractor.getVideoInfo(url, quality=1)
        url = vid.streamURL()
    plugin.set_resolved_url({'path':url, 'info': {'type': 'Video'}})
开发者ID:ruuk,项目名称:plugin.video.geekandsundry,代码行数:8,代码来源:geekandsundry.py

示例3: PlayTrailer

def PlayTrailer(youtube_id):
    import YDStreamExtractor
    YDStreamExtractor.disableDASHVideo(True)
    vid = YDStreamExtractor.getVideoInfo(youtube_id, quality=1)
    if vid:
        stream_url = vid.streamURL()
        log("Youtube Trailer:" + stream_url)
        xbmc.executebuiltin("PlayMedia(%s)" % stream_url)
开发者ID:elnino90,项目名称:script.extendedinfo,代码行数:8,代码来源:Utils.py

示例4: play_trailer

def play_trailer(youtube_id="", listitem=None, popstack=False):
    if not listitem:
        listitem = xbmcgui.ListItem(xbmc.getLocalizedString(20410))
        listitem.setInfo('video', {'Title': xbmc.getLocalizedString(20410), 'Genre': 'Youtube Video'})
    import YDStreamExtractor
    YDStreamExtractor.disableDASHVideo(True)
    vid = YDStreamExtractor.getVideoInfo(youtube_id, quality=1)
    if vid:
        stream_url = vid.streamURL()
        PlayMedia(stream_url, listitem, popstack)
开发者ID:gitter-badger,项目名称:script.extendedinfo,代码行数:10,代码来源:Utils.py

示例5: PlayTrailer

def PlayTrailer(youtube_id="", listitem=None, popstack=False):
    if not listitem:
        listitem =xbmcgui.ListItem ('Trailer')
        listitem.setInfo('video', {'Title': 'Trailer', 'Genre': 'Youtube Video'})
    import YDStreamExtractor
    YDStreamExtractor.disableDASHVideo(True)
    vid = YDStreamExtractor.getVideoInfo(youtube_id, quality=1)
    if vid:
        stream_url = vid.streamURL()
        log("Youtube Trailer:" + stream_url)
        PlayMedia(stream_url, listitem, popstack)
开发者ID:LargeTalons,项目名称:script.extendedinfo,代码行数:11,代码来源:Utils.py

示例6: playVideo

def playVideo(name, url):
        import YDStreamExtractor
        YDStreamExtractor.disableDASHVideo(True) #Kodi (XBMC) only plays the video for DASH streams, so you don't want these normally. Of course these are the only 1080p streams on YouTube

#        url = "https://www.youtube.com/watch?v=" + url #a youtube ID will work as well and of course you could pass the url of another site
        vid = YDStreamExtractor.getVideoInfo(url,quality=1) #quality is 0=SD, 1=720p, 2=1080p and is a maximum
        stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
        print "stream_url =", stream_url
        img = " "
        listitem = xbmcgui.ListItem(name, iconImage=img, thumbnailImage=img)
        playfile = xbmc.Player()
        playfile.play(stream_url, listitem)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:12,代码来源:default.py

示例7: _download

def _download(info, background=True):
    if background:
        YDStreamExtractor.handleDownload(info, bg=True)
    else:
        result = YDStreamExtractor.handleDownload(info, bg=False)
        if result:
            log_utils.log('Download complete: |%s|' % result.filepath)
        elif result.status != 'canceled':
            log_utils.log('Download failed: |%s|' % result.message, log_utils.LOGERROR)
            kodi.notify(msg=result.message, sound=True)
        else:
            log_utils.log('Download cancelled')
开发者ID:anxdpanic,项目名称:context.youtube.download,代码行数:12,代码来源:utils.py

示例8: playYoutubeVideo

 def playYoutubeVideo(self, youtube_id="", listitem=None, popstack=True):
     if not listitem:
         listitem = xbmcgui.ListItem(xbmc.getLocalizedString(20410))
         listitem.setInfo('video', {'Title': xbmc.getLocalizedString(20410), 'Genre': 'Youtube Video'})
     import YDStreamExtractor
     YDStreamExtractor.disableDASHVideo(True)
     if youtube_id:
         vid = YDStreamExtractor.getVideoInfo(youtube_id, quality=1)
         if vid:
             stream_url = vid.streamURL()
             self.play(stream_url, listitem)
     else:
         Notify("no youtube id found")
开发者ID:gitter-badger,项目名称:script.extendedinfo,代码行数:13,代码来源:Utils.py

示例9: resolve

	def resolve(self,url):
		html = client.request(url)
		soup = webutils.bs(html)
		video=soup.find('iframe')['src']
		if 'youtube' in video:
			yt_id = self.yt_video_id(video)
			l = 'http://www.youtube.com/watch?v=' + yt_id

			import YDStreamExtractor
			YDStreamExtractor.disableDASHVideo(True) 
			vid = YDStreamExtractor.getVideoInfo(l,quality=1) 
			resolved = vid.streamURL() 
			return resolved
开发者ID:kevintone,项目名称:tdbaddon,代码行数:13,代码来源:n1.py

示例10: playYoutubeVideo

 def playYoutubeVideo(self, youtube_id="", listitem=None, popstack=True):
     if not listitem:
         listitem = xbmcgui.ListItem ('Trailer')
         listitem.setInfo('video', {'Title': listitem.getProperty('Label'), 'Plot': listitem.getProperty('Description'), 'Genre': 'Youtube Video'})
     import YDStreamExtractor
     YDStreamExtractor.disableDASHVideo(True)
     if youtube_id:
         vid = YDStreamExtractor.getVideoInfo(youtube_id, quality=1)
         if vid:
             stream_url = vid.streamURL()
             log("Youtube Trailer:" + stream_url)
             self.play(stream_url, listitem)
     else:
         Notify("no youtube id found")
开发者ID:Sranshaft,项目名称:script.extendedinfo.immersive,代码行数:14,代码来源:Utils.py

示例11: getExtURL

def getExtURL(urlPage):
  print 'YoutubeDL decoding ' + urlPage
  
  vid = YDStreamExtractor.getVideoInfo(urlPage,quality=2) #quality is 0=SD, 1=720p, 2=1080p and is a maximum
  stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
  
  return stream_url
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:7,代码来源:utils.py

示例12: fullInfo

def fullInfo(videoId):
    fullUrl = "https://www.youtube.com/watch?v=" + videoId
    vid = YDStreamExtractor.getVideoInfo(fullUrl,quality=1)
    
    streamurl = vid.streamURL()
    title = vid.title
    description = vid.description
    thumb = vid.thumbnail    
    
            
    return streamurl, title, description, thumb








# def batchResolve(collection):
#     for video in collection.videoList:
#         thread = ResolveThread(video)
#         thread.start()
# 
# 
# import threading
# class ResolveThread(threading.Thread):
#     def __init__(self, video):
#         threading.Thread.__init__(self)
#         self.video = video
#         
#     def run(self):       
#         print 'starting thread'
#         vid = YDStreamExtractor.getVideoInfo(self.video.fullUrl(),quality=1)
#         print vid.streamURL()
开发者ID:tonymeds,项目名称:Collections,代码行数:35,代码来源:urlResolver.py

示例13: playYoutubeVid

def playYoutubeVid(id, meta=None, poster=None):
    '''
    from resources.lib import pafy
    pafy.set_api_key(vars.API_KEY)
    #Resolve the youtube video url for ourselves
    v = pafy.new(id)
    stream_url = v.getbest().url
    '''
    if meta is None:
        #Create an empty meta, so we can fill it with the information grabbed from youtube
        meta = {}
    if 'title' not in meta:
        meta['title'] = v.title #Store the youtube title in the meta  
    if poster is None:
        poster = 'Default.png'
    
    
    #YDStreamExtractor.disableDASHVideo(True) #Kodi (XBMC) only plays the video for DASH streams, so you don't want these normally. Of course these are the only 1080p streams on YouTube
    try:
        #url = id #a youtube ID will work as well and of course you could pass the url of another site
        vid = YDStreamExtractor.getVideoInfo(id,quality=1) #quality is 0=SD, 1=720p, 2=1080p and is a maximum
        stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
    except:
        dev.log('Failed to get a valid stream_url!')
        return False #Failed to grab a video title
    
    
    #xbmc.Player().play(v.getbest().url) #Play this video
    liz = xbmcgui.ListItem(meta['title'], iconImage=poster, thumbnailImage=poster)
    liz.setInfo( type="Video", infoLabels=meta )
    liz.setPath(stream_url)
    return xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:32,代码来源:play.py

示例14: playYoutubeVid

def playYoutubeVid(id, meta=None, poster=None):
    dev.log('poster: '+poster)
    #Poster URL that hickups the addon: image://C%3a%5cKodi%5cportable_data%5cuserdata%5caddon_data%5cplugin.video.youtubelibrary%5cStreams%5cTV%5cSleuteltje%20-%20Bios%20Intros%5cfolder.jpg/
    #poster = None
    if meta is None:
        #Create an empty meta, so we can fill it with the information grabbed from youtube
        meta = {}
    if poster is None:
        poster = 'Default.png'
    elif poster.startswith('image://'):
        poster = poster[8:-1]
        poster = urllib.unquote(urllib.unquote(poster))
        dev.log('poster cleaned: '+poster)
    
    
    #YDStreamExtractor.disableDASHVideo(True) #Kodi (XBMC) only plays the video for DASH streams, so you don't want these normally. Of course these are the only 1080p streams on YouTube
    
    try:
        #url = id #a youtube ID will work as well and of course you could pass the url of another site
        vid = YDStreamExtractor.getVideoInfo(id,quality=1) #quality is 0=SD, 1=720p, 2=1080p and is a maximum
        stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
    except:
        dev.log('Failed to get a valid stream_url!')
        return False #Failed to grab a video title
    
    if 'title' not in meta:
        meta['title'] = vid.title #Store the youtube title in the meta  
    
    
    #xbmc.Player().play(v.getbest().url) #Play this video
    liz = xbmcgui.ListItem(meta['title'], iconImage=poster, thumbnailImage=poster)
    liz.setInfo( type="Video", infoLabels=meta )
    liz.setPath(stream_url)
    return xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
开发者ID:Sleuteltje,项目名称:plugin.video.youtubelibrary,代码行数:34,代码来源:play.py

示例15: get_video_info

def get_video_info(url):
    info = YDStreamExtractor.getVideoInfo(url)
    if hasattr(info, '_streams'):
        return info
    else:
        log_utils.log('Stream not available: |%s|' % url, log_utils.LOGERROR)
        kodi.notify(msg=kodi.i18n('stream_not_available'), sound=False)
        return None
开发者ID:anxdpanic,项目名称:context.youtube.download,代码行数:8,代码来源:utils.py


注:本文中的YDStreamExtractor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。