Release [Module] youtube-dl - multi-site playable URL resolver
Hello ruuk, very nice addon.

Just discovered youtube-dl and am using it to expand the supported videos on my addon.

This is the code I use:
Code:
def playYoutube_dlVideo(url, name, type):
    #url = "http://www.youtube.com/watch?v=_yVv9dx88x0"   #a youtube ID will work as well and of course you could pass the url of another site
    url='http://www.220.ro/funny/Cocalarus-Retardus/cEWvAHMxuc/'
    url='http://www.3sat.de/mediathek/?mode=play&obj=51264'
    url='http://www.4tube.com/videos/209271/hurry-fuck-i-bored'
    choices = []
    stream_url=""

    if YDStreamExtractor.mightHaveVideo(url,resolve_redirects=True):
        log('might have video=true ' + url)
        vid = YDStreamExtractor.getVideoInfo(url,quality=1,resolve_redirects=True)  #quality is 0=SD, 1=720p, 2=1080p and is a maximum
        
        if vid:
            log("vid is true")
            if vid.hasMultipleStreams():
                log("vid hasMultipleStreams")
                for s in vid.streams():
                    title = s['title']
                    log('choices' + title  )
                    choices.append(title)
                #index = some_function_asking_the_user_to_choose(choices)
                vid.selectStream(0) #You can also pass in the the dict for the chosen stream
    
            stream_url = vid.streamURL()                         #This is what Kodi (XBMC) will play        
            log("stream_url="+stream_url)
            listitem = xbmcgui.ListItem(path=stream_url)
            xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
        else:
            log("can't get getVideoInfo")

I get this error:
Code:
00:28:46 T:7180  NOTICE: script.module.youtube.dl: youtube_dl core version: 2016.05.21.2
00:28:46 T:7180   ERROR: C:\Users\dorpc\AppData\Roaming\Kodi\addons\script.module.youtube.dl\lib\YDStreamExtractor.py:441: UserWarning: External use of disableDASHVideo() is deprecated. It is now handled by module settings
                                              warnings.warn("External use of disableDASHVideo() is deprecated. It is now handled by module settings")
00:28:46 T:7180  NOTICE: reddit_tv:might have video=true http://www.4tube.com/videos/209271/hurry-fuck-i-bored
00:28:46 T:7180  NOTICE: script.module.youtube.dl: ERROR: _getYoutubeDLVideo() failed
00:28:46 T:7180  NOTICE: script.module.youtube.dl: _getYoutubeDLVideo() failed::getVideoInfo (362) - attribute of type 'NoneType' is not callable
00:28:46 T:7180  NOTICE: reddit_tv:can't get getVideoInfo
00:28:47 T:6640   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.reddit_tv/?url=http%3A%2F%2Fwww.4tube.com%2Fvideos%2F209271%2Fhurry-fuck-i-bored&mode=playYoutube_dlVideo&content_type=video]
I'm going through the list of supported sites. Some videos play and some videos don't.
I know it is a pain to keep all those sites supported so it is no big deal if some don't play.
I just want to know if I missed something or is there is anything else I can do to make the video play?
Reply


Messages In This Thread
v14.810.0 - by ruuk - 2014-08-11, 19:45
v14.925.0 - by ruuk - 2014-09-25, 17:49
v14.1026.0 - by ruuk - 2014-10-26, 21:53
v14.1210.0 - by ruuk - 2014-12-10, 23:32
v14.1210.1 - by ruuk - 2014-12-11, 21:17
v15.318.0 - by ruuk - 2015-04-02, 23:01
v15.1123.0 - by ruuk - 2015-11-23, 21:20
v15.1124.0 - by ruuk - 2015-11-24, 21:05
v15.1223.0 - by ruuk - 2015-12-23, 22:27
v16.306.0 - by ruuk - 2016-03-13, 19:05
v16.318.0 - by ruuk - 2016-03-21, 20:31
v16.327.0 - by ruuk - 2016-03-31, 01:12
v16.521.0 - by ruuk - 2016-05-22, 18:15
v16.627.0 - by ruuk - 2016-06-28, 20:38
v16.1026.0 - by ruuk - 2016-10-28, 18:32
v17.310.0 - by ruuk - 2017-03-11, 23:47
v17.518.0 - by ruuk - 2017-05-21, 08:53
v17.518.1 - by ruuk - 2017-05-25, 04:00
v17.709.0 - by ruuk - 2017-07-11, 03:00
v17.1228.0 - by ruuk - 2017-12-28, 22:46
v17.1231.0 - by ruuk - 2018-01-01, 05:46
v18.320.0 - by ruuk - 2018-03-25, 02:07
v18.425.0 - by ruuk - 2018-04-28, 02:53
v14.1217.0 - by ruuk - 2014-12-27, 21:12
RE: Script Error Message - by ruuk - 2016-04-14, 13:15
RE: [Module] youtube-dl - multi-site playable URL resolver - by d0rax - 2016-05-31, 09:36
RE: v16.1026.0 - by Lunatixz - 2016-10-28, 20:25
L0RE - by L0RE - 2017-12-19, 14:34
Script Error Message - by eondesigns1138 - 2016-04-08, 10:46
Error python dependency 2.25.0 - by Alyy - 2016-05-21, 10:45
Logout Mark Read Team Forum Stats Members Help
[Module] youtube-dl - multi-site playable URL resolver2