layer8x / youtube-dl.rb

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

Unable to handle removed media #43

Open benphelps opened 8 years ago

benphelps commented 8 years ago

I'm using #42 in my application and it's working. While it atleast not breaking is great, there are still some bugs with downloading playlists. Specifically when a playlist has media that has been removed (Youtube in this case), you get this error:

STDERR:

ERROR: xPbbVfTxEQY: YouTube said: "Daft Punk - Solar Saile..."
The YouTube account associated with this video has been terminated due to multiple third-party notifications of copyright infringement.
from /home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocaine-0.5.8/lib/cocaine/command_line.rb:91:in `run'

There is a report upstream for youtube-dl here rg3/youtube-dl#2076 and their response was to use --ignore-errors. I'm unsure if this would break other parts of the gem.

sapslaj commented 8 years ago

Hmm, I'll add it to the default options and run the tests to see what happens.

sapslaj commented 8 years ago

Quick Update: Adding --ignore-errors doesn't seem to break anything, but it also doesn't fix this issue because youtube-dl still returns an error exit code.

[sapslaj@rando youtube-dl.rb (add-ignore-errors-to-default-options ✗)]$ vendor/bin/youtube-dl --ignore-errors https://www.youtube.com/playlist\?list\=PLG7ImrZa8ES4uUuNoMUaU-qcB6lXZk9eC
[youtube:playlist] PLG7ImrZa8ES4uUuNoMUaU-qcB6lXZk9eC: Downloading webpage
[download] Downloading playlist: nope playlist
[youtube:playlist] playlist nope playlist: Downloading 2 videos
[download] Downloading video 1 of 2
[youtube] gvdf5n-zI14: Downloading webpage
[youtube] gvdf5n-zI14: Downloading video info webpage
[youtube] gvdf5n-zI14: Extracting video information
[youtube] gvdf5n-zI14: Downloading MPD manifest
[download] Destination: nope.avi-gvdf5n-zI14.mp4
[download] 100% of 1.31MiB in 00:03
[download] Downloading video 2 of 2
[youtube] AfEpQadW9JQ: Downloading webpage
[youtube] AfEpQadW9JQ: Downloading embed webpage
[youtube] AfEpQadW9JQ: Refetching age-gated info webpage
ERROR: AfEpQadW9JQ: YouTube said: Please sign in to view this video.
[download] Finished downloading playlist: nope playlist
[sapslaj@rando youtube-dl.rb (add-ignore-errors-to-default-options)]$ echo $?
1