layer8x / youtube-dl.rb

Ruby wrapper for youtube-dl
MIT License
159 stars 95 forks source link

Freezes with youtube-dl v2017.01.10 #49

Open chinshr opened 7 years ago

chinshr commented 7 years ago

Works on the command line like this:

$ youtube-dl --version
2017.01.10
$ youtube-dl https://www.youtube.com/watch?v=O831FpXh9HM&list=PLZhRxE9191zOGgHxF7TE6bRC1ETO6ya3A

but not within ruby:

YoutubeDL.download "https://www.youtube.com/watch?v=O831FpXh9HM&list=PLZhRxE9191zOGgHxF7TE6bRC1ETO6ya3A", output: "/tmp/ytdl.mp4"
sapslaj commented 7 years ago

Hi sorry for the late reply. The issue looks like youtube-dl is treating this URL as a playlist, and right now this gem is very bad at handling playlists. Playlists should be fixed in v0.4 but I have no idea when that will become a thing. For now, the best solution is to just add playlist: false to the options hash to only download the video and not try to download the entire playlist. So your code would look like this:

YoutubeDL.download "https://www.youtube.com/watch?v=O831FpXh9HM&list=PLZhRxE9191zOGgHxF7TE6bRC1ETO6ya3A", output: "/tmp/ytdl.mp4", playlist: false
chinshr commented 7 years ago

Thanks, I will give it a try!