Kodi Community Forum
Release [Module] youtube-dl - multi-site playable URL resolver - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
---- Thread: Release [Module] youtube-dl - multi-site playable URL resolver (/showthread.php?tid=200877)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


RE: [Module] youtube-dl - multi-site playable URL resolver - ruuk - 2017-11-18

(2017-11-11, 04:22)Trespasser Wrote: Hi ruuk,
Do the same options within youtube-dl (that I use on my Ubuntu 16.04 laptop) work with script.module.youtube.dl? If so, how would I use them? A short example would be nice...Smile.

Presently I using...

youtube-dl -f 94 -g https://www.youtube.com/watch?v=lcIeuqyTM94

to stream a SD m3u8.

I use...

youtube-dl --list-formats https://www.youtube.com/watch?v=lcIeuqyTM94

to list the formats.

It works perfect on my laptop, but I'd like to do the same within Kodi on my RPi3.

Thanks for your time.

Bob
The short answer is no. This add-on is intended primarily as a module that other add-ons can use to resolve site URLs. There is no user facing functionality for any advanced youtube-dl options.


RE: [Module] youtube-dl - multi-site playable URL resolver - ruuk - 2017-11-18

(2017-11-17, 20:10)twilight0 Wrote: Is it possible for youtube-dl to load custom/private plugins from another directory?
No. I'm not aware of any plugin functionality within youtube-dl for which which this add-on is a wrapper.


RE: [Module] youtube-dl - multi-site playable URL resolver - gknibbo - 2017-11-18

Hello!  I installed  youtube-dl addon on my android tv box kodi , but when i open it, from the menu  the only tab that seems to work is Settings . Other options ar not highlighted. Do i have to install smth else?
Oh, just another question : Will it capture/record my favorite internet radios ?  Or is it just for videos?


[Module] youtube-dl - multi-site playable URL resolver - ruuk - 2017-11-18

The options in the menu are mostly for controlling downloads that an add-on using the module have started so they will be disabled unless that has happened. Also, I'm not sure if youtube-dl handles any audio sources.


RE: [Module] youtube-dl - multi-site playable URL resolver - twilight0 - 2017-11-22

(2017-11-18, 01:51)ruuk Wrote:
(2017-11-17, 20:10)twilight0 Wrote: Is it possible for youtube-dl to load custom/private plugins from another directory?
No. I'm not aware of any plugin functionality within youtube-dl for which which this add-on is a wrapper.  

Thank you. Also... Does stream.hasMultipleStreams() function work? I think it doesn't, perhaps I should post an issue at github.

EDIT: Done: https://github.com/ruuk/script.module.youtube.dl/issues/27


RE: [Module] youtube-dl - multi-site playable URL resolver - marcoant - 2017-11-26

I can't download any video in a fresh osmc install (raspberry). Here is the log:
Code:

20:05:12.415 T:1323820016 WARNING: Attempt to use invalid handle -1
20:05:14.508 T:1323820016 WARNING: Previous line repeats 4 times.
20:05:14.508 T:1323820016  NOTICE: script.module.youtube.dl: youtube_dl core version: 2017.07.09
20:05:35.383 T:1340597232 WARNING: CPythonInvoker(16): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
20:05:39.336 T:1340597232  NOTICE: script.module.youtube.dl: youtube_dl core version: 2017.07.09
20:05:39.341 T:1340597232  NOTICE: script.module.youtube.dl: DOWNLOAD SERVICE: START
20:05:39.347 T:1340597232  NOTICE: script.module.youtube.dl: Loading from queue. #1 this session
20:05:40.318 T:1323820016   ERROR: [debug] Encodings: locale UTF-8, fs UTF-8, out missing (instance), pref UTF-8
20:05:40.319 T:1323820016   ERROR: [debug] youtube-dl version 2017.07.09
20:05:40.420 T:1323820016   ERROR: Exception in thread Thread-1:
                                            Traceback (most recent call last):
                                              File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
                                                self.run()
                                              File "/usr/lib/python2.7/threading.py", line 763, in run
                                                self.__target(*self.__args, **self.__kwargs)
                                              File "/home/osmc/.kodi/addons/script.module.youtube.dl/lib/YDStreamExtractor.py", line 320, in _handleDownload
                                                result = download(info, util.TMP_PATH)
                                              File "/home/osmc/.kodi/addons/script.module.youtube.dl/lib/YDStreamExtractor.py", line 409, in download
                                                ytdl = YoutubeDLWrapper._getYTDL()
                                              File "/home/osmc/.kodi/addons/script.module.youtube.dl/lib/YoutubeDLWrapper.py", line 314, in _getYTDL
                                                _YTDL = YoutubeDLWrapper({'verbose': True})
                                              File "/home/osmc/.kodi/addons/script.module.youtube.dl/lib/YoutubeDLWrapper.py", line 190, in __init__
                                                youtube_dl.YoutubeDL.__init__(self, *args, **kwargs)
                                              File "/home/osmc/.kodi/addons/script.module.youtube.dl/lib/youtube_dl/YoutubeDL.py", line 403, in __init__
                                                self.print_debug_header()
                                              File "/home/osmc/.kodi/addons/script.module.youtube.dl/lib/youtube_dl/YoutubeDL.py", line 2176, in print_debug_header
                                                platform.python_version(), platform_name()))
                                            AttributeError: 'module' object has no attribute 'python_version'
20:05:40.460 T:1340597232  NOTICE: script.module.youtube.dl: DOWNLOAD SERVICE: FINISHED

I've tried different regional utf8 configs with no luck. 

locale command return this:
Code:
 LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Any ideas?

Thanks in advance!


RE: [Module] youtube-dl - multi-site playable URL resolver - ruuk - 2017-11-26

Code:
platform.python_version(), platform_name()))
AttributeError: 'module' object has no attribute 'python_version'

This is the actual error. It looks like some sort of problem with your install, because the platform module most definitely has python_version().


RE: [Module] youtube-dl - multi-site playable URL resolver - marcoant - 2017-11-26

(2017-11-26, 00:58)ruuk Wrote:
Code:
platform.python_version(), platform_name()))
AttributeError: 'module' object has no attribute 'python_version'

This is the actual error. It looks like some sort of problem with your install, because the platform module most definitely has python_version(). 
 It's a fresh osmc install. I've made a test.py and print platform.python_version() returns 2.7.9 with no errors. Don't you think the first error line would be the cause of the exception below? 

20:05:40.318 T:1323820016   ERROR: [debug] Encodings: locale UTF-8, fs UTF-8, out missing (instance), pref UTF-8
20:05:40.319 T:1323820016   ERROR: [debug] youtube-dl version 2017.07.09
20:05:40.420 T:1323820016   ERROR: Exception in thread Thread-1:  
...


RE: [Module] youtube-dl - multi-site playable URL resolver - ruuk - 2017-11-26

(2017-11-26, 02:48)marcoant Wrote:
(2017-11-26, 00:58)ruuk Wrote:
Code:
platform.python_version(), platform_name()))
AttributeError: 'module' object has no attribute 'python_version'

This is the actual error. It looks like some sort of problem with your install, because the platform module most definitely has python_version().    
 It's a fresh osmc install. I've made a test.py and print platform.python_version() returns 2.7.9 with no errors. Don't you think the first error line would be the cause of the exception below? 

20:05:40.318 T:1323820016   ERROR: [debug] Encodings: locale UTF-8, fs UTF-8, out missing (instance), pref UTF-8
20:05:40.319 T:1323820016   ERROR: [debug] youtube-dl version 2017.07.09
20:05:40.420 T:1323820016   ERROR: Exception in thread Thread-1:  
...   

Running python outside of OSMC vs inside of OSMC is not the same thing. I understand that you have a fresh OSMC install but this is the first time this error has been reported and this version is four months old, so it looks like something is wrong with the install because of the nature of the error, and the fact that you are the only one with this error. This could be an OSMC bug as well. Also, please note that this add-on is supported on Kodi, and while the media player in OSMC is based on Kodi, it is not Kodi.

It looks like you must have 'Enable youtube-dl verbose logging' enabled. The 'Encodings' and version info are part of debug output for youtube-dl and are informational (in other words, they are not actual errors), and should only be showing (as far as I know) when that is enabled. It also appears the code that is causing this error can only occur when this is enabled. Please make sure that it is not enabled. If you do need to disable it and afterwards have a different error, please share a log. I need the whole log so either use a paste service or, if you like, I can PM you an email address to send it to.


RE: [Module] youtube-dl - multi-site playable URL resolver - marcoant - 2017-11-28

(2017-11-26, 23:59)ruuk Wrote:
(2017-11-26, 02:48)marcoant Wrote:
(2017-11-26, 00:58)ruuk Wrote:
Code:
platform.python_version(), platform_name()))
AttributeError: 'module' object has no attribute 'python_version'

This is the actual error. It looks like some sort of problem with your install, because the platform module most definitely has python_version().      
 It's a fresh osmc install. I've made a test.py and print platform.python_version() returns 2.7.9 with no errors. Don't you think the first error line would be the cause of the exception below? 

20:05:40.318 T:1323820016   ERROR: [debug] Encodings: locale UTF-8, fs UTF-8, out missing (instance), pref UTF-8
20:05:40.319 T:1323820016   ERROR: [debug] youtube-dl version 2017.07.09
20:05:40.420 T:1323820016   ERROR: Exception in thread Thread-1:  
...     

Running python outside of OSMC vs inside of OSMC is not the same thing. I understand that you have a fresh OSMC install but this is the first time this error has been reported and this version is four months old, so it looks like something is wrong with the install because of the nature of the error, and the fact that you are the only one with this error. This could be an OSMC bug as well. Also, please note that this add-on is supported on Kodi, and while the media player in OSMC is based on Kodi, it is not Kodi.

It looks like you must have 'Enable youtube-dl verbose logging' enabled. The 'Encodings' and version info are part of debug output for youtube-dl and are informational (in other words, they are not actual errors), and should only be showing (as far as I know) when that is enabled. It also appears the code that is causing this error can only occur when this is enabled. Please make sure that it is not enabled. If you do need to disable it and afterwards have a different error, please share a log. I need the whole log so either use a paste service or, if you like, I can PM you an email address to send it to.  
 You were right about the error when enabling verbose logging. The script is working fine after disabling it!!! What I don't know is what was the error in the first place and how it was solved. I mean I enabled verbose logging because I couldn't get the script to work at first. I even reinstalled osmc again. Maybe the first osmc install had any problem and maybe the second install was ok but as I directly enabled verbose logging this time I couldn't get it to work too. 

Thanks very much!


RE: [Module] youtube-dl - multi-site playable URL resolver - positronik - 2017-11-28

Hi, I am trying to build my own addon to play videos from rutube.
What I would like to do is to stream the video without downloading it.
The problem is that youtube-dl returns an unplayable link for rutube
videos and therefore also your module gives a wrong url to feed to kodi.
An example of video is the following:

https://rutube.ru/video/a4cb97ea46c570bc3e17993dc3a1079a/?pl_id=12041&pl_type=source

If I feed it into youtube-dl it downloads it without problem, however if I use the -g option to get
the url it gives an unplayable url.

Therefore I guess that the best approach would be to use the download function
of your module and play the video while it is downloading.
However, I haven't managed to understand how to get the path of the downloaded file
and play it while it is downloading.

It's the first addon I am writing for kodi and I am not properly a developer therefore
I am sorry if this is a very noob question...


RE: [Module] youtube-dl - multi-site playable URL resolver - ruuk - 2017-11-29

(2017-11-28, 09:54)positronik Wrote: Hi, I am trying to build my own addon to play videos from rutube.
What I would like to do is to stream the video without downloading it.
The problem is that youtube-dl returns an unplayable link for rutube
videos and therefore also your module gives a wrong url to feed to kodi.
An example of video is the following:

https://rutube.ru/video/a4cb97ea46c570bc3e17993dc3a1079a/?pl_id=12041&pl_type=source

If I feed it into youtube-dl it downloads it without problem, however if I use the -g option to get
the url it gives an unplayable url.

Therefore I guess that the best approach would be to use the download function
of your module and play the video while it is downloading.
However, I haven't managed to understand how to get the path of the downloaded file
and play it while it is downloading.

It's the first addon I am writing for kodi and I am not properly a developer therefore
I am sorry if this is a very noob question...
 The instructions for using this module are in the first post of this thread. Generally speaking, if you can give one of a site's URLs to youtube-dl and it downloads, you can use the instructions in the first post with the same URLs and it should work just fine. You shouldn't need to worry about command line options. This module gives back URL strings that are ready to pass to Kodi for streaming, meaning the User-Agent is already added which is often important to make a stream actually accessible.


RE: [Module] youtube-dl - multi-site playable URL resolver - positronik - 2017-11-29

(2017-11-29, 07:56)ruuk Wrote:
(2017-11-28, 09:54)positronik Wrote: Hi, I am trying to build my own addon to play videos from rutube.
What I would like to do is to stream the video without downloading it.
The problem is that youtube-dl returns an unplayable link for rutube
videos and therefore also your module gives a wrong url to feed to kodi.
An example of video is the following:

https://rutube.ru/video/a4cb97ea46c570bc3e17993dc3a1079a/?pl_id=12041&pl_type=source

If I feed it into youtube-dl it downloads it without problem, however if I use the -g option to get
the url it gives an unplayable url.

Therefore I guess that the best approach would be to use the download function
of your module and play the video while it is downloading.
However, I haven't managed to understand how to get the path of the downloaded file
and play it while it is downloading.

It's the first addon I am writing for kodi and I am not properly a developer therefore
I am sorry if this is a very noob question...
 The instructions for using this module are in the first post of this thread. Generally speaking, if you can give one of a site's URLs to youtube-dl and it downloads, you can use the instructions in the first post with the same URLs and it should work just fine. You shouldn't need to worry about command line options. This module gives back URL strings that are ready to pass to Kodi for streaming, meaning the User-Agent is already added which is often important to make a stream actually accessible.  
Thanks for your answer, unfortunately the links that the module provides for rutube are not playable and the player returns 'Failed to recognize file format'.
This problem arises from the fact that youtube-dl provide the wrong link to be played.
However both your addon and youtube-dl download it correctly if I use the download function.
You can see it by yourself with the link in my previous post.

EDIT: I think I have found a solution. Basically your module return the url of the best quality that happens to be a f4m file for rutube's videos and Kodi can't play it. The next-to-best video quality is an m3u file and Kodi can play it. It would be awesome if you would add the format selection in your module, in the meantime I am using a custom function written by myself. If you want I can share it with you.


RE: [Module] youtube-dl - multi-site playable URL resolver - maXity - 2017-12-05

The latest version in the repo (17.709.0) is based on youtube-dl core 2017.07.09, which is not compatible with many websites any more.

First post says that the add-on is "designed to be updated by dropping in the youtube-dl core without modification".

I'm unsure how to do that - can somebody explain please?

Thank you!


RE: [Module] youtube-dl - multi-site playable URL resolver - Ebs_1 - 2017-12-05

hi,
first of all great addon thanks.

i have aproblem with some playlist i get:
"_getYoutubeDLVideo() failed::getVideoInfo (374) - 'format_id'"

dont realy know why?
can you help please
thanks,
here is the code:

'''
import YDStreamExtractor
url = 'https://www.youtube.com/watch?v=ZOYQ94ylTGY&list=RDZOYQ94ylTGY'## This dont work
url='https://www.youtube.com/watch?v=2Vv-BfVoq4g&list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG'#this works.
YDStreamExtractor._BLACKLIST = []

vid = YDStreamExtractor.getVideoInfo(url,resolve_redirects=True,quality=1)
logging.warning( vid)
choices = []
if vid.hasMultipleStreams():
    for s in vid.streams():
    #print 's is %s' %s
        xbmc_url = s['xbmc_url']
        choices.append(xbmc_url)


ret = xbmcgui.Dialog().select("בחר סרטון", choices)
'''

thank you very much


This forum uses Lukasz Tkacz MyBB addons.