coletdjnz / yt-dlp-youtube-oauth2

Plugin that adds OAuth2 login support to yt-dlp's YouTube extractors
The Unlicense
174 stars 22 forks source link

[youtube+oauth2] YouTube said: ERROR - Request contains an invalid argument. #20

Closed Elite closed 1 week ago

Elite commented 1 month ago
yt-dlp -v -F https://www.youtube.com/watch?v=BaW_jenozKc --username oauth2 --password ''
[debug] Command-line config: ['-v', '-F', 'https://www.youtube.com/watch?v=BaW_jenozKc', '--username', 'PRIVATE', '--password', 'PRIVATE']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.08.06 from yt-dlp/yt-dlp [4d9231208]
[debug] Lazy loading extractors is disabled
[debug] Python 3.12.4 (CPython x86_64 64bit) - Linux-5.15.0-113-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg N-115881-g0ae157b360 (fdk,setts), ffprobe N-115881-g0ae157b360
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.06.02, mutagen-1.47.0, requests-2.32.3, secretstorage-3.3.1, sqlite3-3.37.2, urllib3-2.2.2, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Extractor Plugins: oauth2 (YoutubeBaseInfoExtractor), oauth2 (YoutubeClipIE), oauth2 (YoutubeConsentRedirectIE), oauth2 (YoutubeFavouritesIE), oauth2 (YoutubeIE), oauth2 (YoutubeMusicSearchURLIE), oauth2 (YoutubeNotificationsIE), oauth2 (YoutubeSearchDateIE), oauth2 (YoutubeSearchIE), oauth2 (YoutubeSearchURLIE), oauth2 (YoutubeTabBaseInfoExtractor), oauth2 (YoutubeTabIE)
[debug] Plugin directories: ['/usr/local/lib/python3.12/dist-packages/yt_dlp_plugins']
[debug] Loaded 1830 extractors
[debug] Loading youtube-oauth2.token_data from cache
[youtube+oauth2] Extracting URL: https://www.youtube.com/watch?v=BaW_jenozKc
[youtube+oauth2] BaW_jenozKc: Downloading webpage
[youtube+oauth2] BaW_jenozKc: Downloading ios player API JSON
[youtube+oauth2] BaW_jenozKc: Downloading web creator player API JSON
WARNING: [youtube+oauth2] YouTube said: ERROR - Request contains an invalid argument.
WARNING: [youtube+oauth2] HTTP Error 400: Bad Request. Retrying (1/3)...
[youtube+oauth2] BaW_jenozKc: Downloading web creator player API JSON
WARNING: [youtube+oauth2] YouTube said: ERROR - Request contains an invalid argument.
WARNING: [youtube+oauth2] HTTP Error 400: Bad Request. Retrying (2/3)...
[youtube+oauth2] BaW_jenozKc: Downloading web creator player API JSON
WARNING: [youtube+oauth2] YouTube said: ERROR - Request contains an invalid argument.
WARNING: [youtube+oauth2] HTTP Error 400: Bad Request. Retrying (3/3)...
[youtube+oauth2] BaW_jenozKc: Downloading web creator player API JSON
WARNING: [youtube+oauth2] YouTube said: ERROR - Request contains an invalid argument.
WARNING: [youtube+oauth2] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[youtube+oauth2] BaW_jenozKc: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] Available formats for BaW_jenozKc:
ID      EXT   RESOLUTION FPS CH │   FILESIZE  TBR PROTO │ VCODEC         VBR ACODEC      ABR ASR MORE INFO
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb0     mhtml 48x27       10    │                 mhtml │ images                                 storyboard
233     mp4   audio only        │                 m3u8  │ audio only         unknown             [en] Default, IOS
234     mp4   audio only        │                 m3u8  │ audio only         unknown             [en] Default, IOS
139-drc m4a   audio only      2 │   60.21KiB  49k https │ audio only         mp4a.40.5   49k 22k [en] low, DRC, IOS, m4a_dash
139     m4a   audio only      2 │   60.20KiB  49k https │ audio only         mp4a.40.5   49k 22k [en] low, IOS, m4a_dash
140-drc m4a   audio only      2 │  157.14KiB 130k https │ audio only         mp4a.40.2  130k 44k [en] medium, DRC, IOS, m4a_dash
140     m4a   audio only      2 │  157.16KiB 130k https │ audio only         mp4a.40.2  130k 44k [en] medium, IOS, m4a_dash
269     mp4   256x144     30    │ ~ 83.18KiB  68k m3u8  │ avc1.4D400C    68k video only          IOS
160     mp4   256x144     30    │   14.93KiB  12k https │ avc1.4D400C    12k video only          144p, IOS, mp4_dash
230     mp4   640x360     30    │ ~205.33KiB 168k m3u8  │ avc1.4D401E   168k video only          IOS
134     mp4   640x360     30    │   29.39KiB  24k https │ avc1.4D401E    24k video only          360p, IOS, mp4_dash
605     mp4   640x360     30    │ ~255.88KiB 210k m3u8  │ vp09.00.21.08 210k video only          IOS
232     mp4   1280x720    30    │ ~247.03KiB 202k m3u8  │ avc1.4D401F   202k video only          IOS
136     mp4   1280x720    30    │   59.04KiB  49k https │ avc1.4D401F    49k video only          720p, IOS, mp4_dash
270     mp4   1920x1080   30    │ ~484.67KiB 397k m3u8  │ avc1.640028   397k video only          IOS
137     mp4   1920x1080   30    │  286.74KiB 239k https │ avc1.640028   239k video only          1080p, IOS, mp4_dash

Well it seems the file gets downloaded fine but these warnings are shown, what can be done to avoid these warnings?

amrutadotorg commented 1 month ago

See https://github.com/ytdl-org/youtube-dl/issues/2630

Elite commented 1 month ago

I am now receiving "429 Too Many Requests" when using local socks5 proxy server to rotate my ip's. Seems related to this - https://github.com/LuanRT/YouTube.js/issues/725

Elite commented 1 month ago

@coletdjnz It seems the reason could be oauth2 plugin not using the proxy details provided to yt-dlp, also, does oauth needs to performed for every request?

coletdjnz commented 1 month ago

@coletdjnz It seems the reason could be oauth2 plugin not using the proxy details provided to yt-dlp, also, does oauth needs to performed for every request?

It uses the proxy details, since the requests go through yt-dlp's central http client.

It adds the token to every youtube request. It sounds like you are in general IP blocked from youtube due to requesting too much, which is unlikely to be related to this plugin.

observeroftime01 commented 1 month ago

I have very much the same issue and I don't think it is related to proxies, I don't use any:

A verbose log of an up-to-date local build ``` PS C:\Users\user> yt-dlp -v -F https://www.youtube.com/watch?v=znv0TQsR5jk [debug] Command-line config: ['-v', '-F', 'https://www.youtube.com/watch?v=znv0TQsR5jk'] [debug] Portable config "C:\Users\user\apps\yt-dlp\yt-dlp.conf": ['--sponsorblock-mark', 'all', '--username', 'PRIVATE', '--password', 'PRIVATE', '-P', 'C:/Users/user/Videos/youtube-dl', '-o', '%(uploader)s - %(title)s [%(id)s].%(ext)s', '-f', 'bestvideo*[height<=?1440]+bestaudio/best', '--sub-langs', 'en, en-orig, en-gb', '--write-subs', '--add-metadata', '--embed-metadata', '--embed-chapters'] [debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8 [debug] yt-dlp-daily version local@2024.08.10 [150430cdd] (win_exe) [debug] Python 3.11.9 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 3.0.13 30 Jan 2024) [debug] exe versions: ffmpeg 2024-06-27-git-9a3bc59a38-full_build-www.gyan.dev (setts), ffprobe 2024-06-27-git-9a3bc59a38-full_build-www.gyan.dev, phantomjs 2.1.1 [debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.07.04, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.45.1, urllib3-2.2.2, websockets-12.0 [debug] Proxy map: {} [debug] Request Handlers: urllib, requests, websockets, curl_cffi [debug] Extractor Plugins: NSigDeno+oauth2 (YoutubeIE), Youtube_NsigDenoIE, oauth2 (YoutubeBaseInfoExtractor), oauth2 (YoutubeClipIE), oauth2 (YoutubeConsentRedirectIE), oauth2 (YoutubeFavouritesIE), oauth2 (YoutubeMusicSearchURLIE), oauth2 (YoutubeNotificationsIE), oauth2 (YoutubeSearchDateIE), oauth2 (YoutubeSearchIE), oauth2 (YoutubeSearchURLIE), oauth2 (YoutubeTabBaseInfoExtractor), oauth2 (YoutubeTabIE) [debug] Loaded 1831 extractors [debug] Loading youtube-oauth2.token_data from cache [youtube+NSigDeno+oauth2] Extracting URL: https://www.youtube.com/watch?v=znv0TQsR5jk [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading webpage [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading ios player API JSON [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON WARNING: [youtube+NSigDeno+oauth2] YouTube said: ERROR - Request contains an invalid argument. WARNING: [youtube+NSigDeno+oauth2] HTTP Error 400: Bad Request. Retrying (1/3)... [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON WARNING: [youtube+NSigDeno+oauth2] YouTube said: ERROR - Request contains an invalid argument. WARNING: [youtube+NSigDeno+oauth2] HTTP Error 400: Bad Request. Retrying (2/3)... [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON WARNING: [youtube+NSigDeno+oauth2] YouTube said: ERROR - Request contains an invalid argument. WARNING: [youtube+NSigDeno+oauth2] HTTP Error 400: Bad Request. Retrying (3/3)... [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON WARNING: [youtube+NSigDeno+oauth2] YouTube said: ERROR - Request contains an invalid argument. WARNING: [youtube+NSigDeno+oauth2] Unable to download API page: HTTP Error 400: Bad Request (caused by ) [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading m3u8 information [debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto [debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id [SponsorBlock] Fetching SponsorBlock segments [debug] SponsorBlock query: https://sponsor.ajay.app/api/skipSegments/e1f3?service=YouTube&categories=%5B%22chapter%22%2C+%22selfpromo%22%2C+%22poi_highlight%22%2C+%22outro%22%2C+%22filler%22%2C+%22music_offtopic%22%2C+%22preview%22%2C+%22intro%22%2C+%22interaction%22%2C+%22sponsor%22%5D&actionTypes=%5B%22skip%22%2C+%22poi%22%2C+%22chapter%22%5D [SponsorBlock] Found 1 segments in the SponsorBlock database [info] Available formats for znv0TQsR5jk: ID EXT RESOLUTION FPS CH │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC ABR ASR MORE INFO ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── sb2 mhtml 48x27 0 │ mhtml │ images storyboard sb1 mhtml 80x45 0 │ mhtml │ images storyboard sb0 mhtml 160x90 0 │ mhtml │ images storyboard 233 mp4 audio only │ m3u8 │ audio only unknown [en] Default, IOS 234 mp4 audio only │ m3u8 │ audio only unknown [en] Default, IOS 139-drc m4a audio only 2 │ 12.22MiB 49k https │ audio only mp4a.40.5 49k 22k [en] low, DRC, IOS, m4a_dash 139 m4a audio only 2 │ 12.22MiB 49k https │ audio only mp4a.40.5 49k 22k [en] low, IOS, m4a_dash 140-drc m4a audio only 2 │ 32.42MiB 129k https │ audio only mp4a.40.2 129k 44k [en] medium, DRC, IOS, m4a_dash 140 m4a audio only 2 │ 32.42MiB 129k https │ audio only mp4a.40.2 129k 44k [en] medium, IOS, m4a_dash 394 mp4 256x144 30 │ 10.68MiB 43k https │ av01.0.00M.08 43k video only 144p, IOS, mp4_dash 269 mp4 256x144 30 │ ~ 41.88MiB 167k m3u8 │ avc1.4D400C 167k video only IOS 160 mp4 256x144 30 │ 7.41MiB 30k https │ avc1.4D400C 30k video only 144p, IOS, mp4_dash 395 mp4 426x240 30 │ 12.94MiB 52k https │ av01.0.00M.08 52k video only 240p, IOS, mp4_dash 396 mp4 640x360 30 │ 23.30MiB 93k https │ av01.0.01M.08 93k video only 360p, IOS, mp4_dash 230 mp4 640x360 30 │ ~182.93MiB 731k m3u8 │ avc1.4D401E 731k video only IOS 134 mp4 640x360 30 │ 24.91MiB 100k https │ avc1.4D401E 100k video only 360p, IOS, mp4_dash 605 mp4 640x360 30 │ ~143.57MiB 573k m3u8 │ vp09.00.21.08 573k video only IOS 397 mp4 854x480 30 │ 38.01MiB 152k https │ av01.0.04M.08 152k video only 480p, IOS, mp4_dash 398 mp4 1280x720 30 │ 71.90MiB 287k https │ av01.0.05M.08 287k video only 720p, IOS, mp4_dash 232 mp4 1280x720 30 │ ~380.78MiB 1521k m3u8 │ avc1.4D401F 1521k video only IOS 136 mp4 1280x720 30 │ 62.78MiB 251k https │ avc1.4D401F 251k video only 720p, IOS, mp4_dash ```

the --print-traffic output looks odd to me. The request to the web_creator client api appears to be malformed when used with the oauth2 plugin (I had to remove some sensitive data from the output but it shouldn't affect anything):

--print-traffic of a failing request with oauth2 enabled ``` WARNING: [youtube+NSigDeno+oauth2] HTTP Error 400: Bad Request. Retrying (1/3)... [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100 director: Checking if "requests" supports this request. director: Sending request via "requests" send: b'POST /youtubei/v1/player?prettyPrint=false HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.5196.0 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nContent-Type: application/json\r\nX-Youtube-Client-Name: 62\r\nX-Youtube-Client-Version: 1.20240723.03.00\r\nOrigin: https://www.youtube.com\r\nAuthorization: Bearer ya29.-\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: PREF=f6=80&hl=en&tz=UTC; SOCS=CAI; YSC=9j7__cOFvGg; VISITOR_INFO1_LIVE=N6TOS5H3F44; VISITOR_PRIVACY_METADATA=%3D%3D\r\nContent-Length: 333\r\n\r\n' send: b'{"context": {"client": {"clientName": "WEB_CREATOR", "clientVersion": "1.20240723.03.00", "hl": "en", "timeZone": "UTC", "utcOffsetMinutes": 0}}, "videoId": "znv0TQsR5jk", "playbackContext": {"contentPlaybackContext": {"html5Preference": "HTML5_PREF_WANTS", "signatureTimestamp": 19942}}, "contentCheckOk": true, "racyCheckOk": true}' reply: 'HTTP/1.1 400 Bad Request\r\n' header: Vary: Origin header: Vary: X-Origin header: Vary: Referer header: Content-Type: application/json; charset=UTF-8 header: Content-Encoding: br header: Date: Sat, 10 Aug 2024 21:56:45 GMT header: Server: scaffolding on HTTPServer2 header: Content-Length: 141 header: X-XSS-Protection: 0 header: X-Frame-Options: SAMEORIGIN header: X-Content-Type-Options: nosniff header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 requests: https://www.youtube.com:443 "POST /youtubei/v1/player?prettyPrint=false HTTP/11" 400 141 WARNING: [youtube+NSigDeno+oauth2] YouTube said: ERROR - Request contains an invalid argument. ```

Without the oauth2 plugin, the request looks like this when it is working:

--print-traffic of a working request with oauth2 disabled ``` [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100 director: Checking if "requests" supports this request. director: Sending request via "requests" send: b'POST /youtubei/v1/player?prettyPrint=false HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.125 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nContent-Type: application/json\r\nX-Youtube-Client-Name: 62\r\nX-Youtube-Client-Version: 1.20240723.03.00\r\nOrigin: https://www.youtube.com\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: PREF=hl=en&tz=UTC; SOCS=CAI; GPS=1; YSC=jyu92Xbjr-s; VISITOR_INFO1_LIVE=rbJURjM1DTE; VISITOR_PRIVACY_METADATA=CgJDQRIEGgAgNA%3D%3D\r\nContent-Length: 333\r\n\r\n' send: b'{"context": {"client": {"clientName": "WEB_CREATOR", "clientVersion": "1.20240723.03.00", "hl": "en", "timeZone": "UTC", "utcOffsetMinutes": 0}}, "videoId": "znv0TQsR5jk", "playbackContext": {"contentPlaybackContext": {"html5Preference": "HTML5_PREF_WANTS", "signatureTimestamp": 19942}}, "contentCheckOk": true, "racyCheckOk": true}' reply: 'HTTP/1.1 200 OK\r\n' header: Content-Type: application/json; charset=UTF-8 header: Vary: Origin header: Vary: X-Origin header: Vary: Referer header: Content-Encoding: br header: Date: Sat, 10 Aug 2024 22:10:49 GMT header: Server: scaffolding on HTTPServer2 header: Content-Length: 28110 header: X-XSS-Protection: 0 header: X-Frame-Options: SAMEORIGIN header: X-Content-Type-Options: nosniff header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 requests: https://www.youtube.com:443 "POST /youtubei/v1/player?prettyPrint=false HTTP/11" 200 28110 ```

At any rate, disabling the oauth2 plugin by removing --username and --password from my config makes the requests work just fine, so it is not a networking issue:

Spoiler warning ``` PS C:\Users\user> yt-dlp -v -F https://www.youtube.com/watch?v=znv0TQsR5jk [debug] Command-line config: ['-v', '-F', 'https://www.youtube.com/watch?v=znv0TQsR5jk'] [debug] Portable config "C:\Users\user\apps\yt-dlp\yt-dlp.conf": ['--sponsorblock-mark', 'all', '-P', 'C:/Users/user/Videos/youtube-dl', '-o', '%(uploader)s - %(title)s [%(id)s].%(ext)s', '-f', 'bestvideo*[height<=?1440]+bestaudio/best', '--sub-langs', 'en, en-orig, en-gb', '--write-subs', '--add-metadata', '--embed-metadata', '--embed-chapters'] [debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8 [debug] yt-dlp-daily version local@2024.08.10 [150430cdd] (win_exe) [debug] Python 3.11.9 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 3.0.13 30 Jan 2024) [debug] exe versions: ffmpeg 2024-06-27-git-9a3bc59a38-full_build-www.gyan.dev (setts), ffprobe 2024-06-27-git-9a3bc59a38-full_build-www.gyan.dev, phantomjs 2.1.1 [debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.07.04, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.45.1, urllib3-2.2.2, websockets-12.0 [debug] Proxy map: {} [debug] Request Handlers: urllib, requests, websockets, curl_cffi [debug] Extractor Plugins: NSigDeno+oauth2 (YoutubeIE), Youtube_NsigDenoIE, oauth2 (YoutubeBaseInfoExtractor), oauth2 (YoutubeClipIE), oauth2 (YoutubeConsentRedirectIE), oauth2 (YoutubeFavouritesIE), oauth2 (YoutubeMusicSearchURLIE), oauth2 (YoutubeNotificationsIE), oauth2 (YoutubeSearchDateIE), oauth2 (YoutubeSearchIE), oauth2 (YoutubeSearchURLIE), oauth2 (YoutubeTabBaseInfoExtractor), oauth2 (YoutubeTabIE) [debug] Loaded 1831 extractors [youtube+NSigDeno+oauth2] Extracting URL: https://www.youtube.com/watch?v=znv0TQsR5jk [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading webpage [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading ios player API JSON [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading web creator player API JSON [debug] Loading youtube-nsig.28fd7348 from cache [debug] [youtube+NSigDeno+oauth2] Decrypted nsig FfNlse1uz7RhUCN0H => Y44aVPdvZhuH7Q [youtube+NSigDeno+oauth2] znv0TQsR5jk: Downloading m3u8 information [debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto [debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id [SponsorBlock] Fetching SponsorBlock segments [debug] SponsorBlock query: https://sponsor.ajay.app/api/skipSegments/e1f3?service=YouTube&categories=%5B%22filler%22%2C+%22interaction%22%2C+%22poi_highlight%22%2C+%22outro%22%2C+%22intro%22%2C+%22selfpromo%22%2C+%22sponsor%22%2C+%22preview%22%2C+%22chapter%22%2C+%22music_offtopic%22%5D&actionTypes=%5B%22skip%22%2C+%22poi%22%2C+%22chapter%22%5D [SponsorBlock] Found 1 segments in the SponsorBlock database [info] Available formats for znv0TQsR5jk: ID EXT RESOLUTION FPS CH │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC ABR ASR MORE INFO ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── sb2 mhtml 48x27 0 │ mhtml │ images storyboard sb1 mhtml 80x45 0 │ mhtml │ images storyboard sb0 mhtml 160x90 0 │ mhtml │ images storyboard 233 mp4 audio only │ m3u8 │ audio only unknown [en] Default, IOS 234 mp4 audio only │ m3u8 │ audio only unknown [en] Default, IOS 139-drc m4a audio only 2 │ 12.22MiB 49k https │ audio only mp4a.40.5 49k 22k [en] low, DRC, IOS, m4a_dash 139 m4a audio only 2 │ 12.22MiB 49k https │ audio only mp4a.40.5 49k 22k [en] low, IOS, m4a_dash 140-drc m4a audio only 2 │ 32.42MiB 129k https │ audio only mp4a.40.2 129k 44k [en] medium, DRC, IOS, m4a_dash 140 m4a audio only 2 │ 32.42MiB 129k https │ audio only mp4a.40.2 129k 44k [en] medium, IOS, m4a_dash 394 mp4 256x144 30 │ 10.68MiB 43k https │ av01.0.00M.08 43k video only 144p, IOS, mp4_dash 269 mp4 256x144 30 │ ~ 41.88MiB 167k m3u8 │ avc1.4D400C 167k video only IOS 160 mp4 256x144 30 │ 7.41MiB 30k https │ avc1.4D400C 30k video only 144p, IOS, mp4_dash 395 mp4 426x240 30 │ 12.94MiB 52k https │ av01.0.00M.08 52k video only 240p, IOS, mp4_dash 396 mp4 640x360 30 │ 23.30MiB 93k https │ av01.0.01M.08 93k video only 360p, IOS, mp4_dash 230 mp4 640x360 30 │ ~182.93MiB 731k m3u8 │ avc1.4D401E 731k video only IOS 134 mp4 640x360 30 │ 24.91MiB 100k https │ avc1.4D401E 100k video only 360p, IOS, mp4_dash 18 mp4 640x360 30 2 │ ≈ 57.19MiB 228k https │ avc1.42001E mp4a.40.2 44k [en] 360p, WEB-C 605 mp4 640x360 30 │ ~143.57MiB 573k m3u8 │ vp09.00.21.08 573k video only IOS 397 mp4 854x480 30 │ 38.01MiB 152k https │ av01.0.04M.08 152k video only 480p, IOS, mp4_dash 398 mp4 1280x720 30 │ 71.90MiB 287k https │ av01.0.05M.08 287k video only 720p, IOS, mp4_dash 232 mp4 1280x720 30 │ ~380.78MiB 1521k m3u8 │ avc1.4D401F 1521k video only IOS 136 mp4 1280x720 30 │ 62.78MiB 251k https │ avc1.4D401F 251k video only 720p, IOS, mp4_dash ```

I have been experiencing this for about a week or so and never thought to check the open issues. I hope the additional information provided can prove useful in tracking down the issue. If any further information is required I'd be happy to provide it.

coletdjnz commented 1 month ago

Hmm, thanks for testing. I can reproduce too.

It appears that the web_creator client doesn't work with oauth :thinking:

Playing around in mitmproxy, if I remove the Authorization bearer header it works.

The full error response for interest is

 {
    "error": {
        "code": 400,
        "errors": [
            {
                "domain": "global",
                "message": "Request contains an invalid argument.",
                "reason": "badRequest"
            }
        ],
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT"
    }
}

I've been told ios_creator and android_creator similarly don't work with cookies, which might be related. Seems like youtube locks these clients down

Elite commented 1 month ago

@coletdjnz Great, eagerly waiting to get a new update with this fixed.

coletdjnz commented 1 month ago

For the time being, you can try using another client if you are missing formats from web_creator. E.g. --extractor-args youtube:player-client=default,mweb

Elite commented 1 month ago

I am using this on my public facing server with proxy rotation, so you are saying using the above yt-dlp arguments prevent the "Sign in" message and also mitigate the 429 OAUTH2 plugin bug?

coletdjnz commented 1 month ago

Awaiting https://github.com/yt-dlp/yt-dlp/pull/10710 so we can easily switch out clients

Botato300 commented 2 weeks ago

Awaiting yt-dlp/yt-dlp#10710 so we can easily switch out clients

I think they already merge it to the main branch!