當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。