youtube-dl-rs
youtube-dl-rs copied to clipboard
This video requires payment to watch
Error: non-zero exit code: 1, stderr: ERROR: [youtube] Ylb4jP1zTX0: This video requires payment to watch
ERROR: [youtube] iHg0p_pL9ZM: This video requires payment to watch
ERROR: [youtube] dR9S96jUey4: This video requires payment to watch
ERROR: [youtube] nSOAF9lGQLo: This video requires payment to watch
Caused by:
non-zero exit code: 1, stderr: ERROR: [youtube] Ylb4jP1zTX0: This video requires payment to watch
ERROR: [youtube] iHg0p_pL9ZM: This video requires payment to watch
ERROR: [youtube] dR9S96jUey4: This video requires payment to watch
ERROR: [youtube] nSOAF9lGQLo: This video requires payment to watch
Is there a way to fix this, skip the videos, etc?
What exactly are you trying to do?
Get video/channel data, this channel happens to have paid videos which crash yt-dlp, I just wanna skip the paid videos, I believe there's an ignore errors flag or something for that but youtube_dl would have to use that flag.
Can you pass it manually? (with this method)
Ah I didn't see that, that'll work, thanks!
I believe the flag is --no-abort-on-error but it may and/or be --ignore-errors
Cool, glad I could help.
This is related, would be nice to have JSON errors, or a way to filter out errors with a flag, but considering no progress over almost two years, I wouldn't count on it any time soon. https://github.com/yt-dlp/yt-dlp/issues/1659
To make my findings clearer, I've deleted my previous comments as they were contradictory.
I found that the --ignore-errors and --no-abort-on-error flags didn't do anything, or anything noticeable in this case.
I also found that the exit code of yt-dlp is always 1 if there's stderr, so the explicit success check prevents youtube_dl from parsing the valid JSON in stdout.
My suggestion would be an ignore_errors builder function to toggle a bool that skips the exit code check, but after that I ran into another problem, that the video that was premium/errored is "null" in the entries JSON which serde_json fails to parse into a Playlist struct.
JSON: https://pastebin.com/8e2YS6y0