Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-abort-on-error --ignore-errors do not work on Youtube private videos #9810

Open
10 of 11 tasks
maaaaz opened this issue Apr 28, 2024 · 4 comments
Open
10 of 11 tasks
Labels
docs/meta/cleanup related to docs, code cleanup, templates, devscripts etc question Question

Comments

@maaaaz
Copy link

maaaaz commented Apr 28, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

France

Provide a description that is worded well enough to be understood

Hello there,

The following command should be provoke an error thanks to the options passed --no-abort-on-error --ignore-errors, but unfortunately it is:

$ yt-dlp --no-abort-on-error --ignore-errors --restrict-filenames -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' 'https://www.youtube.com/watch?v=wBwJ7ETeRdE' ; echo $?
[youtube] Extracting URL: https://www.youtube.com/watch?v=wBwJ7ETeRdE
[youtube] wBwJ7ETeRdE: Downloading webpage
[youtube] wBwJ7ETeRdE: Downloading ios player API JSON
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
ERROR: [youtube] wBwJ7ETeRdE: Private video. Sign in if you've been granted access to this video
1

Technical information about the results above:

$ cat /etc/issue*
Kali GNU/Linux Rolling \n \l

Kali GNU/Linux Rolling

$ yt-dlp --version
2023.11.16

$ uname -mrsa
Linux adm-ClawVintage 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64 GNU/Linux

Can you fix that bug ?

Cheers !

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

$ yt-dlp --no-abort-on-error --ignore-errors --restrict-filenames -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' 'https://www.youtube.com/watch?v=wBwJ7ETeRdE' ; echo $?
[youtube] Extracting URL: https://www.youtube.com/watch?v=wBwJ7ETeRdE
[youtube] wBwJ7ETeRdE: Downloading webpage
[youtube] wBwJ7ETeRdE: Downloading ios player API JSON
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...
[youtube] wBwJ7ETeRdE: Downloading android player API JSON
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
ERROR: [youtube] wBwJ7ETeRdE: Private video. Sign in if you've been granted access to this video
1
@maaaaz maaaaz added site-bug Issue with a specific website triage Untriaged issue labels Apr 28, 2024
@bashonly
Copy link
Member

bashonly commented Apr 29, 2024

--no-abort-on-error is the default, but you have only passed 1 URL for a single video (not a playlist), so it is irrelevant in your example.

Regarding --ignore-errors, I think this isn't a bug, but rather a case where the documentation may need to be clarified.

The Python API documentation is more accurate, IMO:

    ignoreerrors:      Do not stop on download/postprocessing errors.
                       Can be 'only_download' to ignore only download errors.
                       Default is 'only_download' for CLI, but False for API

--ignore-errors tells yt-dlp to continue past an error if there is anything to continue to. But in your example log, there is an error during extraction of a single video URL and thus there is nothing else to be done.

There is no mention of exit codes in either the CLI docs or the API docs for this option.

@bashonly bashonly added docs/meta/cleanup related to docs, code cleanup, templates, devscripts etc question Question and removed site-bug Issue with a specific website triage Untriaged issue labels Apr 29, 2024
@bashonly
Copy link
Member

Possibly related: #9614, #2947

@maaaaz
Copy link
Author

maaaaz commented Apr 29, 2024

Thanks.
I indeed want to highlight here the fact that --ignore-errors should return an exit 0 code, nothing else as it is misleading.

@maaaaz
Copy link
Author

maaaaz commented May 1, 2024

Here is a way to filter private videos in a playlist:

$ yt-dlp <playlist_url> --ignore-errors --flat-playlist --dump-single-json | jq --raw-output -M '.entries | .[] | select(.title != "[Private video]") | .url'

@maaaaz maaaaz mentioned this issue May 1, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs/meta/cleanup related to docs, code cleanup, templates, devscripts etc question Question
Projects
None yet
Development

No branches or pull requests

2 participants