ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.36k stars 10.04k forks source link

Sign in to confirm you’re not a bot - message unclear (and this time using the issue template) #32960

Open mdavis-xyz opened 2 weeks ago

mdavis-xyz commented 2 weeks ago

Checklist

Verbose log

$ youtube-dl -v "https://www.youtube.com/watch?v=zvP3FJfPgx8"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=zvP3FJfPgx8']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.12.3 (CPython x86_64 64bit) - Linux-6.8.0-47-generic-x86_64-with-glibc2.39 - OpenSSL 3.0.13 30 Jan 2024 - glibc 2.39
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] zvP3FJfPgx8: Downloading webpage
ERROR: Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Traceback (most recent call last):
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/YoutubeDL.py", line 875, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/YoutubeDL.py", line 971, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/extractor/common.py", line 571, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/extractor/youtube.py", line 2248, in _real_extract
    raise ExtractorError(reason, expected=True)
youtube_dl.utils.ExtractorError: Sign in to confirm you’re not a bot
This helps protect our community. Learn more

Description

When trying to download some videos, I get an error message, telling me to sign in and confirm I'm not a bot. The error message appears incomplete, so it's hard for me to know how to sign in, or learn more.

Steps to reproduce:

$ youtube-dl -v "https://www.youtube.com/watch?v=VsG4zXzQwBs"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=VsG4zXzQwBs']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.12.3 (CPython x86_64 64bit) - Linux-6.8.0-47-generic-x86_64-with-glibc2.39 - OpenSSL 3.0.13 30 Jan 2024 - glibc 2.39
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] VsG4zXzQwBs: Downloading webpage
ERROR: Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Traceback (most recent call last):
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/YoutubeDL.py", line 875, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/YoutubeDL.py", line 971, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/extractor/common.py", line 571, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthew/venv/lib/python3.12/site-packages/youtube_dl/extractor/youtube.py", line 2248, in _real_extract
    raise ExtractorError(reason, expected=True)
youtube_dl.utils.ExtractorError: Sign in to confirm you’re not a bot
This helps protect our community. Learn more

There's two things about this error message which I think should be improved:

  1. Sign in? How? Where? The error message does not say, and the readme does not mention the phrase "sign in".
  2. "Learn more" - ok, how? Where? It seems like the rest of that sentence is missing, or perhaps this was supposed to be rendered as a hyperlink to something?

Note that I don't get this behavior for all videos. This one worked:

$ youtube-dl -v "https://www.youtube.com/watch?v=wOvyF6jFKa8"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=wOvyF6jFKa8']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.12.3 (CPython x86_64 64bit) - Linux-6.8.0-47-generic-x86_64-with-glibc2.39 - OpenSSL 3.0.13 30 Jan 2024 - glibc 2.39
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] wOvyF6jFKa8: Downloading webpage
[youtube] wOvyF6jFKa8: Downloading player fb725ac8
[debug] [youtube] Decrypted nsig VH0az-_4sTterYE2 => I_HeD02AtpQ_XA
[debug] [youtube] Decrypted nsig 7t_v2cysifiN8ObX => yhctZpqRjAGNWg
[debug] Default format spec: best/bestvideo+bestaudio
[debug] Invoking downloader on 'https://rr2---sn-25ge7nzk.googlevideo.com/videoplayback?expire=1729883126&ei=lpcbZ-uSOem3mLAPqKDk6Qs&ip=80.239.186.177&id=o-AP5Ix71aMWUT1ifJRCanuEz7GeCEfJt03q3eB1ulYjtC&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1729861526%2C&mh=g0&mm=31%2C26&mn=sn-25ge7nzk%2Csn-5hneknek&ms=au%2Conr&mv=m&mvi=2&pl=27&rms=au%2Cau&initcwndbps=651250&bui=AQn3pFSYT6282GQSSkXGknnOUsvKVprkaQ8uojZlwJJnjZbJwueSuzbZDqdzZTOkKpHub7b5oOj5dmy1&spc=qtApAc1u6Ar0zfFF0FZkcota8GELVKmlaHw3o7kaqk0-pl6lCgNvcvOejRmpQcA&vprv=1&svpuc=1&mime=video%2Fmp4&ns=Ztku3Eph-tS4WuW2uAkiH3AQ&rqh=1&gir=yes&clen=40429114&ratebypass=yes&dur=464.399&lmt=1712638545393852&mt=1729861298&fvip=1&fexp=51312688%2C51326931&c=WEB&sefc=1&txp=5319224&n=I_HeD02AtpQ_XA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRQIgddk3yXeXpe6WWVRHXykGIWeruEQK-qqc2sSP0NexNmoCIQC4w1kCa9e05e-tzrqeZAkMh9QqdekpZgsaqQmlgj1Fvw%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=ACJ0pHgwRgIhAIrz3AW5zAbc7L0_R29UJXb25YoUEuQem5htbKeLmfzQAiEAyO7zCn6j2dfgHQKzDACPDo_6S1SE4pprbXCof_2mepo%3D'
[download] Destination: Je teste mon cadeau de Noël 🎁 -  B1 #8-wOvyF6jFKa8.mp4
[download] 100% of 38.56MiB in 00:32

There are of course several duplicates of this, (almost) all closed because they were low-effort tickets without the debug info. (Wow those really were low-effort posts. I feel sorry for the maintainers.) Hopefully I've met the requirements for using the template etc.

dirkf commented 2 weeks ago

Thanks for the issue, and for linking the defective reports.

"Site support" means something that's specific to a particular website, in this case YouTube. So, this is such an issue.

The message comes directly from the text sent by YT, so it means "Sign in ... [to YouTube]".

Some other error messages from extractors are presented as {IE_NAME} says: {error_message}, but this has to be coded specially in each case. This would make it clearer when a message has been generated by the site itself. It should be the default when an ExtractorError is raised that includes a specific extractor in its parameters; there is WIP code for this.

As to the actual problem, the most detailed diagnosis is at yt-dlp/yt-dlp#10128 to which I linked when this was first reported here.

tldr;

Most likely the decision as to whether your access is flagged is made by some unaccountable and inexplicable machine-learning bot. A great benefit of this is that it saves time that anypne might have spent trying to work out the underlying logic since there is none, in the sense of probably being massively too complex and too variable.

[debug] youtube-dl version 2021.12.17

I presume you've built your own yt-dl from the master code here. It's probably better to use the ytdl-nightly repo.