youtube-dl-rs icon indicating copy to clipboard operation
youtube-dl-rs copied to clipboard

This video requires payment to watch

Open ShayBox opened this issue 2 years ago • 7 comments

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?

ShayBox avatar Mar 18 '23 04:03 ShayBox

What exactly are you trying to do?

GyrosOfWar avatar Mar 18 '23 12:03 GyrosOfWar

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.

ShayBox avatar Mar 18 '23 15:03 ShayBox

Can you pass it manually? (with this method)

GyrosOfWar avatar Mar 18 '23 16:03 GyrosOfWar

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

ShayBox avatar Mar 18 '23 16:03 ShayBox

Cool, glad I could help.

GyrosOfWar avatar Mar 18 '23 16:03 GyrosOfWar

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

ShayBox avatar Mar 18 '23 19:03 ShayBox

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

ShayBox avatar Mar 19 '23 02:03 ShayBox