Page 1 of 2

YoutubeDL

PostPosted: Mon May 04, 2015 5:32 pm
by programmer
YouTubeDL is YouTube plugin (Web Resource plugin).
It uses youtube-dl as external process.
As such it accepts any YouTube URLs that you use in your browser.

Instructions:
- Download youtube-dl from the link above, and put it anywhere in the system path (or update YOUTUBE_DL to full path inside the script).
- Note that ffmpeg that comes with serviio does not support https downloads. So you'll need updated version of ffmpeg (I use the one from here)
- Some playlist cause StackOverflow error in groovy json parser (JsonSlurper). This is known bug in old groovy version that Serviio uses (1.8.6). To solve it, replace groovy-all.jar in lib directory to newer version (I used groovy-all-2.3.7.jar successfully).

For troubleshooting enable logging via config\log4j.xml

<category name="org.serviio.library.online">
<priority value="DEBUG"/>
</category>

and post the log in case of any problems.

Edit 08/05/2015: new version performs much less http requests

Re: YoutubeDL

PostPosted: Mon May 04, 2015 7:14 pm
by stefana888
The Youtube-DL tools work great for accessing restricted content (with enchiphered signatures), such as music channel videos, hence be aware that there may be an issue with Serviio accidently violating the Youtube site "Terms Of Servce" using the tool.

Re: YoutubeDL

PostPosted: Mon May 04, 2015 9:11 pm
by stefana888
It seems a bit slow extracting the maximum of 50 titles, ids and thumbs...

  Code:
2015-05-04 23:07:47,647 WARN  [FeedUpdaterThread] An error occured while parsing the online resource https://www.youtube.com/user/gmmgrammyofficial/videos, will try again soon: Unexpected error while invoking plugin (YouTubeDL): The operation took more than 30000 ms and has been cancelled.
org.serviio.library.online.metadata.OnlineResourceParseException: Unexpected error while invoking plugin (YouTubeDL): The operation took more than 30000 ms and has been cancelled.
   at org.serviio.library.online.WebResourceParser.parse(WebResourceParser.java:78)
   at org.serviio.library.online.OnlineLibraryManager.findResource(OnlineLibraryManager.java:181)
   at org.serviio.library.online.OnlineLibraryManager.findResourceInCacheOrParse(OnlineLibraryManager.java:198)
   at org.serviio.library.online.metadata.FeedUpdaterThread.getOnlineItems(FeedUpdaterThread.java:185)
   at org.serviio.library.online.metadata.FeedUpdaterThread.run(FeedUpdaterThread.java:108)
Caused by: java.lang.RuntimeException: The operation took more than 30000 ms and has been cancelled.
   at org.serviio.library.online.PluginExecutionProcessor.execute(PluginExecutionProcessor.java:64)
   at org.serviio.library.online.WebResourceUrlExtractor.parseWebResource(WebResourceUrlExtractor.java:29)
   at org.serviio.library.online.WebResourceParser.parse(WebResourceParser.java:76)
   ... 4 more

Re: YoutubeDL

PostPosted: Tue May 05, 2015 12:01 pm
by programmer
Right it seems 30 sec timeout is not always enough to retrieve 50 items.
You can try to reduce 50 to something like 20 (on line 38 of YoutubeDL.groovy).

Re: YoutubeDL

PostPosted: Tue May 05, 2015 2:04 pm
by Ultimat
1st - respect for your work!

2nd:
programmer wrote:Right it seems 30 sec timeout is not always enough to retrieve 50 items.
You can try to reduce 50 to something like 20 (on line 38 of YoutubeDL.groovy).


Will bee nice, if you can impliment 2 more features:

1)int getExtractItemsTimeout() - Description:
Returns the number of seconds after which the plugin's extractItems() thread will be terminated
(or marked as terminated). Defaults to 30 if the method is not implemented. - in this case we will set needed timeout if 30 sec is not enough.

2)check max items in response. If in serviio UI selected to retrieve unlimited items and max items count (in response)>50, then loop throw pages (max 50 items per page). In this case we will get all items from interesting playlist/.../chanel/... in one folder. without creating one more record for next 50 items and withows new folder for each next 50 items. Will be good to implement variable to set max pages for loop and/or max items cout to retrive if set unlimited in UI, like now implemented on line 38 of YoutubeDL.groovy.

after that, your plugin will be the most powerfull for all of as.

Thank you!

Re: YoutubeDL

PostPosted: Tue May 05, 2015 3:46 pm
by stefana888
Just override the timeout to >300s and take care of youtube-dl option 'max-downloads NUMBER' which must override the maximum set by Serviio.

Re: YoutubeDL

PostPosted: Wed May 06, 2015 6:50 am
by programmer
Unfortunately 30 sec is Serviio limit which plugins can not change.

Re: YoutubeDL

PostPosted: Wed May 06, 2015 6:53 am
by Ultimat
No, just need override function in plugin body:
int getExtractItemsTimeout()
Description:
Returns the number of seconds after which the plugin's extractItems() thread will be terminated
(or marked as terminated). Defaults to 30 if the method is not implemented.

https://bitbucket.org/xnejp03/serviio/issue/618/add-a-gettimeout-method

Re: YoutubeDL

PostPosted: Wed May 06, 2015 8:51 am
by programmer
Thanks Ultimat, I'll try that.

Re: YoutubeDL

PostPosted: Fri May 08, 2015 7:10 am
by programmer
Uploaded new version that performs less http requests, by parsing json retrieved by youtube-dl. Also added getExtractItemsTimeout.
If you get StackOverflow error in groovy json parser (JsonSlurper), replace groovy-all.jar in lib directory to newer version (I used groovy-all-2.3.7.jar successfully).

Re: YoutubeDL

PostPosted: Mon May 11, 2015 12:25 pm
by Ultimat
It works perfectly!

The only thing with this approach, it is necessary to significantly increase the timeout. For example, for one my playlist of 35 videos, I had to increase the timeout to 3 minutes. But it's worth it, especially now that there are no problems.

Re: YoutubeDL

PostPosted: Mon May 18, 2015 9:11 pm
by tuareg64ve
If I use YoutubeDL to get a Live channel I have some issues.
So I modify the main part to make a test:

  Code:
    static void main(args) {
   // this is just to test
        YouTubeDL extractor = new YouTubeDL()
      
   assert extractor.extractorMatches( new URL("https://www.youtube.com/watch?v=AJtDXIazrMo&list=PLDcnymzs18LVXfO_x0Ei0R24qDbVtyy66") )
      
   //WebResourceContainer container = extractor.extractItems( new URL("https://www.youtube.com/watch?v=AJtDXIazrMo&list=PLDcnymzs18LVXfO_x0Ei0R24qDbVtyy66"), 10)
   WebResourceContainer container = extractor.extractItems( new URL("https://www.youtube.com/watch?v=sw4hmqVPe0E"), 10)
   println container
   ContentURLContainer result = extractor.extractUrl(container.getItems()[2], PreferredQuality.MEDIUM)
   println result
    }



The following is the result.
Why this error?

  Code:
Caught: java.lang.NullPointerException: Cannot get property 'additionalInfo' on null object


  Code:
[root@nas serviio]# java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
[root@nas serviio]# groovy -cp lib/serviio.jar:lib/slf4j-api.jar:lib/slf4j-log4j12.jar:lib/log4j.jar:lib/org.restlet.jar plugins/YoutubeDL.groovy
WebResourceContainer [title=null, thumbnailUrl=https://i.ytimg.com/vi/sw4hmqVPe0E/hqdefault.jpg, items=[WebResourceItem [title=Sky News Live, cacheKey=null, additionalInfo={140=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/140/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/audio%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/12A347F4DA8DD7FD8808743561455F82A03FDD43.469D6B35C555EA0F533B609859D2166B5379F4DC/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 141=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/141/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/audio%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/0E295A20C689E1EF03515824C2C0DC0B7C0874EB.2E7DCC00BDBC0C51AEAB18FCF7EEB68CE957F1F4/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 160=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/160/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/058294DDE58141FAF6B06BB0E019324BE8280CEB.618D2A4A0CCDAA778A1C018BAB9CF6B1747781A3/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 133=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/133/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/64EDA91A6332E5E8CA88430BF4B323DE90A7546B.362BA67D6B0C5BE2DB13A651FED30FEBA666B4E4/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 134=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/134/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/0222E6829798E495C9CEF5C377DCF9AE9282A4E4.583AE49C88AD3D3EED387E78D6F62D17DF60C3A3/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 135=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/135/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/243BC876AB3632CBC0235879100E9984528BA125.0AFFFE0A82A0EFFE0EFEBAB9A2EE73CAFC2009C6/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 136=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/136/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/75B163F0B3308C08D9FEB30E4D108796FCF442E2.7D5C130227179643BC5F50AFB16DA6C77AD16477/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 137=https://r18---sn-1gi7znel.googlevideo.com/videoplayback/id/sw4hmqVPe0E.1/itag/137/source/yt_live_broadcast/requiressl/yes/gcr/ch/playlist_type/DVR/pmbypass/yes/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/upn/8QWDnsa7vQk/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/key/cms1/sver/3/signature/6AE91D1AF47D822DD1F0F9A62ECB78C764836BA3.0B6B7162D26A866A14E4D73DEE9E3FC558855A1D/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,mn,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/mn/sn-1gi7znel/ms/lv/mt/1431982640/mv/u/pl/22, 151=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/151/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.151/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/283F7F0CC7478661B7091645CE438A73D1BDC3AD.111667E1117905122C078BA780201E64B04F6B23/key/dg_yt0/file/index.m3u8, 132=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/132/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.132/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/75ABF997633B22D474A30B89D821427D1A57B59E.0C637AC12542BEB7893643608C53D73EF3845818/key/dg_yt0/file/index.m3u8, 92=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/92/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.92/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/5BBDFA5A9B27C25F779FF6F9089C7FFC238D190D.03C0498823CBD3E5BDAD44E309ADD14E7A5C2731/key/dg_yt0/file/index.m3u8, 93=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/93/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.93/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/0E0AE2A63CC8E46F00AF8B5F7F69834FDE38E5FE.2B57F2E1CCE0F4BC4086B3361540739E4B549C8C/key/dg_yt0/file/index.m3u8, 94=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/94/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.94/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/3C84970AE6E32CDD522ABE8CF606D44ED4816FA6.9473917D055BA2D506F7E68646220FA57D657E72/key/dg_yt0/file/index.m3u8, 95=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.95/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/34E4F38731281BC8C5E17C89CB3E363EEFF51442.4D1F0A1E98A86C9D138F7E696EBECC47D04F0126/key/dg_yt0/file/index.m3u8, 96=https://manifest.googlevideo.com/api/manifest/hls_playlist/id/sw4hmqVPe0E.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/gir/yes/dg_shard/c3c0aG1xVlBlMEUuMQ.96/hls_chunk_host/r18---sn-1gi7zn7y.googlevideo.com/gcr/ch/pmbypass/yes/maudio/1/playlist_type/DVR/mm/32/mn/sn-1gi7zn7y/ms/lv/mv/u/pl/22/dover/2/upn/DmWJ6486tCs/fexp/936109,9406690,9408142,9408214,9408581,9408707,9408710,9408787,9412515,9412859,945137,948124,952612,952637,952642/sver/3/mt/1431983081/ip/77.59.134.178/ipbits/0/expire/1432004688/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,gir,dg_shard,hls_chunk_host,gcr,pmbypass,maudio,playlist_type,mm,mn,ms,mv,pl/signature/8575D376828990EB3B866BD6C12AE71C333C1748.92CAEC2895B7EFBEC101DE8A4D5C0B9143A4606E/key/dg_yt0/file/index.m3u8, thumb=https://i.ytimg.com/vi/sw4hmqVPe0E/hqdefault.jpg, videoId=sw4hmqVPe0E}, releaseDate=Mon May 18 23:03:44 CEST 2015]]]
Caught: java.lang.NullPointerException: Cannot get property 'additionalInfo' on null object
java.lang.NullPointerException: Cannot get property 'additionalInfo' on null object
   at YouTubeDL.extractUrl(YoutubeDL.groovy:58)
   at YouTubeDL.main(YoutubeDL.groovy:165)

Re: YoutubeDL

PostPosted: Tue May 19, 2015 11:12 am
by programmer
This channel uses Apple HTTP Live Streaming formats, which currently are not listed in the 'availableFormats' constant. Not sure why because latest ffmpeg versions support it. You can try to add the following to 'availableFormats' and see if it works:
'96','95','94','93','92','132','151'

Re: YoutubeDL

PostPosted: Tue May 19, 2015 9:34 pm
by tuareg64ve
programmer wrote:This channel uses Apple HTTP Live Streaming formats, which currently are not listed in the 'availableFormats' constant. Not sure why because latest ffmpeg versions support it. You can try to add the following to 'availableFormats' and see if it works:
'96','95','94','93','92','132','151'


unfortunately does not work

Re: YoutubeDL

PostPosted: Sun May 24, 2015 5:09 pm
by tuareg64ve
another thing.
My favorites playlist is:

https://www.youtube.com/playlist?list=F ... WILj8F1vKA

I have tried manually adding this code:

  Code:
    static void main(args) {
   // this is just to test
        YouTubeDL extractor = new YouTubeDL()
      
   assert extractor.extractorMatches( new URL("https://www.youtube.com/watch?v=AJtDXIazrMo&list=PLDcnymzs18LVXfO_x0Ei0R24qDbVtyy66") )
      
   //WebResourceContainer container = extractor.extractItems( new URL("https://www.youtube.com/watch?v=AJtDXIazrMo&list=PLDcnymzs18LVXfO_x0Ei0R24qDbVtyy66"), 10)
   //WebResourceContainer container = extractor.extractItems( new URL("https://www.youtube.com/watch?v=sw4hmqVPe0E"), 10)
   WebResourceContainer container = extractor.extractItems( new URL("https://www.youtube.com/playlist?list=FL_kiJU4qQmNi7WILj8F1vKA"), 10)
   //println container
   ContentURLContainer result = extractor.extractUrl(container.getItems()[2], PreferredQuality.MEDIUM)
   println result
    }


the result is:

  Code:
[root@nas serviio]# groovy -cp lib/serviio.jar:lib/slf4j-api.jar:lib/slf4j-log4j12.jar:lib/log4j.jar:lib/org.restlet.jar plugins/YoutubeDL.groovy
ContentURLContainer [fileType=VIDEO, contentUrl=https://r19---sn-1gi7zne7.googlevideo.com/videoplayback?sparams=dur%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&gcr=ch&mm=31&source=youtube&signature=F33C2D9F9388CC39DAAF343C9EF6FCB530FC961B.9D7B8FAF16ECEBB2FC6F556BB89DDC26BDC80858&id=o-AMF8dX7-Tt8dYpr5cazKnrel2AP_Li60R1Ahyc7DvAu-&dur=581.543&mime=video%2Fmp4&ms=au&requiressl=yes&ratebypass=yes&mt=1432487163&pl=22&ip=77.59.134.178&fexp=937517%2C9408142%2C9408710%2C9413503%2C9415304%2C948124%2C952612&expire=1432508867&initcwndbps=2285000&ipbits=0&itag=18&key=yt5&upn=wQHaA3r4O_Y&mv=m&sver=3, thumbnailUrl=https://i.ytimg.com/vi/vclCPTI2qGU/maxresdefault.jpg, expiresOn=Mon May 25 01:07:47 CEST 2015, expiresImmediately=false, cacheKey=youtubedl_vclCPTI2qGU_18, live=false, ]


so, apparently it does not get any error
but the icon in Serviio is empty
any idea?

Re: YoutubeDL

PostPosted: Mon May 25, 2015 8:54 am
by programmer
Just to make sure, you added this playlist in online sources, right? main() is only for testing purpose.
Check the log for any errors (or post it here).

Re: YoutubeDL

PostPosted: Mon May 25, 2015 9:59 am
by tuareg64ve
programmer wrote:Just to make sure, you added this playlist in online sources, right? main() is only for testing purpose.
Check the log for any errors (or post it here).


yes, I have added, the icon is under ONLINE, but it is empty
there is no error in the log
I only have error like this:

  Code:
2015-05-24 23:27:48,340 DEBUG [RepositoryServerResource] Updating repository with values: OnlineRepository [repositoryUrl=https://www.youtube.com/playlist?list=FL_kiJU4qQmNi7WILj8F1vKA, fileType=VIDEO, repoType=WEB_RESOURCE, userEnteredThumbnailUrl=null, repositoryName=Youtube Preferiti, enabled=true, accessGroupIds=[1], order=44, id=493]


what is in your Serviio? Could you add your Youtube favorites?

Re: YoutubeDL

PostPosted: Mon May 25, 2015 11:52 am
by programmer
Your playlist is working fine for me (I'm on Windows).
Can't say what is the problem without anything in your log, can you can PM me your full log? I'll try to help.

Re: YoutubeDL

PostPosted: Sat Aug 08, 2015 6:49 am
by DTigerBKK
Nice work!! Just starting to enjoy it.

But (yes I know, there's always one :D )
- I confirm the default 60 seconds in getExtractItemsTimeout() is kinda short. I also needed a minimum of 3*60.
- Is it possible to imagine a cross platform way to call a youtube-dl command and not a complete path to the exe?
- Last but not least, we can now imagine to give youtube-dl some line parameters, right?

Re: YoutubeDL

PostPosted: Sun Aug 09, 2015 12:29 pm
by programmer
Thanks,
you can change timeout and add parameters you like inside the script, let me know if you need help with that.
The cross-platform way can work if you put youtube-dl in system path, and specify YOUTUBE_DL constant to be 'youtube-dl' (without the .exe).