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

YT: TVHTML5 API JSON: ERROR: Sign in to confirm youre not a bot #33030

Open
6 tasks done
tansy opened this issue Jan 18, 2025 · 2 comments
Open
6 tasks done

YT: TVHTML5 API JSON: ERROR: Sign in to confirm youre not a bot #33030

tansy opened this issue Jan 18, 2025 · 2 comments

Comments

@tansy
Copy link

tansy commented Jan 18, 2025

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2025.01.16
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Description and Verbose log

YT: TVHTML5 API JSON: ERROR: Sign in to confirm youre not a bot

Using newest nightly build (25-01-16), downloading format list or video itself fails with this error:
ERROR: Sign in to confirm youre not a bot
while using earlier version (25-01-06) does not.

$ ./ytdl-2025.01.06 -F https://www.youtube.com/watch?v=OjOiWe9MHNk
[youtube] OjOiWe9MHNk: Downloading webpage
[youtube] OjOiWe9MHNk: Downloading API JSON
[info] Available formats for OjOiWe9MHNk:
format code  extension  resolution note
599          m4a        audio only audio_quality_ultralow   30k , m4a_dash container, mp4a.40.5 (22050Hz), 6.87MiB
599-drc      m4a        audio only audio_quality_ultralow   30k , m4a_dash container, mp4a.40.5 (22050Hz), 6.87MiB
(...)
313          webm       3840x2160  2160p 11113k , webm_dash container, vp9, 30fps, video only, 2.42GiB
18           mp4        640x360    360p  459k , avc1.42001E, 30fps, mp4a.40.2 (44100Hz), 102.64MiB (best)

$ ./ytdl-2025.01.16 -F https://www.youtube.com/watch?v=OjOiWe9MHNk
[youtube] OjOiWe9MHNk: Downloading webpage
[youtube] OjOiWe9MHNk: Downloading TVHTML5 API JSON
ERROR: Sign in to confirm you’re not a bot
This helps protect our community. Learn more

Verbose

$ ./youtube-dl-1 -v -F https://www.youtube.com/watch?v=OjOiWe9MHNk
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.youtube.com/watch?v=OjOiWe9MHNk']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2025.01.16 [55ad8a24c] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 2.7.11 (CPython i686 32bit) - OpenSSL 1.0.1e 11 Feb 2013 - glibc 2.0
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] OjOiWe9MHNk: Downloading webpage
[youtube] OjOiWe9MHNk: Downloading TVHTML5 API JSON
ERROR: Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Traceback (most recent call last):
  File "./ytdl-nightly-2025.01.16/youtube_dl/YoutubeDL.py", line 879, in wrapper
    return func(self, *args, **kwargs)
  File "./ytdl-nightly-2025.01.16/youtube_dl/YoutubeDL.py", line 975, in __extract_info
    ie_result = ie.extract(url)
  File "./ytdl-nightly-2025.01.16/youtube_dl/extractor/common.py", line 571, in extract
    ie_result = self._real_extract(url)
  File "./ytdl-nightly-2025.01.16/youtube_dl/extractor/youtube.py", line 2387, in _real_extract
    raise ExtractorError(reason, expected=True)
ExtractorError: Sign in to confirm you\u2019re not a bot
This helps protect our community. Learn more

Same for download.

1c1
< $ ./ytdl-2025.01.16 -v -F https://www.youtube.com/watch?v=OjOiWe9MHNk
---
> $ ./ytdl-2025.01.16 -v -f 18 https://www.youtube.com/watch?v=OjOiWe9MHNk
5c5
< [debug] Command-line args: [u'-v', u'-F', u'https://www.youtube.com/watch?v=OjOiWe9MHNk']
---
> [debug] Command-line args: [u'-v', u'-f', u'18', u'https://www.youtube.com/watch?v=OjOiWe9MHNk']

It seems to be triggered/aggrevated by adding 'level/s of indirection', I mean 'links' to it, but I'm not entirely sure how could it cause it.

$ echo /path/to/ytdl-nightly-2025.01.06 \"\$\@\" > ytdl-2025.01.06; chmod +x ytdl-2025.01.06
$ echo /path/to/ytdl-nightly-2025.01.16 \"\$\@\" > ytdl-2025.01.16; chmod +x ytdl-2025.01.16

Worse part of it is that it sometimes work. And when it works then few times in a row, when doesn't the same - time and time again.

@dirkf
Copy link
Contributor

dirkf commented Jan 18, 2025

You can have 2025.01.16 and have some chance of getting a successful download other than format 18, or 2025.01.06 and have no such chance.

Also, #32960, though I agree that it seems to be more prevalent with the tv client.

Possibly sign-in will be permanently forced on the tv client as it is with some others, and as JS has now been forced on G search. "Don't be evil", indeed.

@tansy
Copy link
Author

tansy commented Jan 18, 2025

So I tested it and success ratio is like 1:2.

$ while : ; do ytdl-nightly-2025.01.16 -v -f 18 https://www.youtube.com/watch?v=S2FlRxQJQyw; echo $? >> exit-status; rm -f *.mp4; printf "\n####\n\n"; done
$ cat exit-status
 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 1 0 0 1 0 1 0 1

When I add famous user agent, I get different error (most of the time):

$ UA="Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36"
$ ./ytdl-nightly-2025.01.16 -v --user-agent "$UA" -f 18 https://www.youtube.com/watch?v=S2FlRxQJQyw; echo $? >> exit-status; rm -f *.mp4; printf "\n####\n\n"; done

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--user-agent', u'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36', u'-f', u'18', u'https://www.youtube.com/watch?v=S2FlRxQJQyw']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2025.01.16 [55ad8a24c] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 2.7.11 (CPython i686 32bit) - OpenSSL 1.0.1e 11 Feb 2013 - glibc 2.0
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] S2FlRxQJQyw: Downloading webpage
[youtube] S2FlRxQJQyw: Downloading TVHTML5 API JSON
[debug] [youtube] Decrypted nsig SkeAZi4_-LXAJBP5Q => nlNxdduN3HzMIg
[debug] [youtube] Decrypted nsig 5IBsrSGHpC1JcsvRu => bjJrNuC7KWdwoQ
[youtube] S2FlRxQJQyw: Downloading API JSON
ERROR: Missing "title" field in extractor result; please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
Traceback (most recent call last):
  File "./ytdl-nightly-2025.01.16/youtube_dl/YoutubeDL.py", line 879, in wrapper
    return func(self, *args, **kwargs)
  File "./ytdl-nightly-2025.01.16/youtube_dl/YoutubeDL.py", line 986, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "./ytdl-nightly-2025.01.16/youtube_dl/YoutubeDL.py", line 1020, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "./ytdl-nightly-2025.01.16/youtube_dl/YoutubeDL.py", line 1648, in process_video_result
    raise ExtractorError('Missing "title" field in extractor result')
ExtractorError: Missing "title" field in extractor result; please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.

$ UA="Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36"
$ while : ; do ytdl-nightly-2025.01.16 -v --user-agent "$UA" -f 18 https://www.youtube.com/watch?v=S2FlRxQJQyw; echo $? >> exit-status; rm -f *.mp4; printf "\n####\n\n"; done
$ cat exit-status
 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

and success ratio drops to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants