-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[Youtube] Got server error HTTP Error 403: Forbidden(latest master version) #32905
Comments
Indeed this seems to be a pathological video where almost all video formats fail on the first fragment and 299 may fail later, regardless of Python 2.7/3.5/3.9 and User-Agent settings. yt-dlp 2024.08.06 still works, apparently. It has fancy networking that we can't easily replicate: maybe punt to curl for all requests? |
I have that with every single video I try. Curiously enough format '18' work all the time. Other formats that work are '136', '137', '248' and/or '160', but it depends on video - not always the case. Still, format '18' is the most reliable to work. |
So
|
Can confirm that a lot of the video-only formats are just being 403-ed in the middle with their downloads, resulting in me getting files that stop after about 10-20 minutes into the video, but still have full sized audio. By now I have written something into my scripts to just pick format 18 as long as a flag is set, because i foresee this issue happening again in the future once it is eventually fixed... >.> |
So has anyone tried fetching fragments in fragments of <1MB? We already had a work-around to download in fragments to avoid throttling IIRC. Otherwise:
|
Apparently the latest fix worked for not even a day, that doesn't bode well. Personally I keep getting "giving up after 0 fragment retries" in my python stuff. From what I read in yesterdays thread, it seems like this will just not work out with fake JS interpretation if they try to combat this in the slightest. Like, that almost doesn't deserve the name attack vector, that's an attack landscape. |
This change is significant. I checked old, pre quantum Firefox and videos don't work any more, when 3 days ago they did. |
Maybe the new player JS uses some G JS syntax extension (aka ECMA2021+) that hadn't been contemplated in those FF versions. Is there an error in the JS console? |
It used to work as embedded or as mobile (when used mobile user agent). Now all of them display all saying error:
Loading any video at https://www.youtube.com/embed/1234567890a:
Then pressing play:
ED. If it's of any help, despite what was said before, there are some videos that work. First - this one doesn't, and gives following console log
This one does and, with this log:
So, after clicking 'play' it gives this error: |
No matter what chunk size I use I'm seeing hard 403 errors at 1Meg as others have reported - I'm able to download as many fragments as I want up to 1Meg and then get a 403. Have experimented with generating It feels like they've added a check somewhere which fails at the 1Meg mark but I haven't found anything yet where that might be. Checking via the browser I can see that youtube is happily downloading |
But in the browser the media links have the In line with step 1 above, I'm gradually pulling stuff from the yt-dlp extractor, enough to download HLS with client |
I'm not seeing a Edit: Looks like the playbackCookie / POST data is extracted from the bytes of the previous fragment response somehow |
This is the procedure that I am using in my own code. Load https://www.youtube.com/embed/<id#> and find the base.js link. Do the usual to extract the sig and n-sig. Extract the signatureTimestamp for the next step. Load https://www.youtube.com/youtubei/v1/player with the signatureTimestamp and TVHTML5_SIMPLY_EMBEDDED_PLAYER as the client name. If the JSON response contains "formats" and/or "adaptiveFormats" then we're good. This covers most videos, including age-gated ones. The 403 problem occurs when we have go to the next step. We can't use "www.youtube.com". We must use "m.youtube.com" with the user agent set to something like "Mozilla/5.0 (Android 14)" which is what I'm using. Load https://m.youtube.com/watch?v=<id#> and extract the JSON structures that you would otherwise have gotten from the previous step. And that's it. The extra step is only required for videos that disallow embedding. |
Please don't bother to supply any "me too" reports unless the log shows some novelty that may help with rectification. Just "Like", or whatever, an existing similar report. You can see how a @8chanAnon's algorithm is what is currently done for age-gate videos, up to the last step with Step 2 will only work if |
Indeed, Android 14/FF 122 at m.youtube.com didn't list the |
I don't think it's worth trying to get around the poToken, it will eventually be required in all clients. I keep digging into There's a |
This comment was marked as outdated.
This comment was marked as outdated.
On a lot of websites I want to download from youtube-dl and curl dont even get the correct html, Instead I have a bash-script that predownloads the non-captcha html via "https://github.com/lwthiker/curl-impersonate" (runs in docker container , i use tag: 0.5.2-ff-alpine) AFAIK lwthiker/curl-impersonate is the only http client that completly impersonates an actual browser like firefox. |
Yes, but so far as captcha is generally understood (G/recaptcha, hacaptcha, Cloudflare challenge aka breaks the Web), that is not the problem. Even if it solved the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
Probably a continuation of item 2 here. |
At this point, YouTube is doing it intentionally, right? People report error 403, a fix/workaround is found, and then a few days later, 403 errors again. |
I don't suppose that YT ships code accidentally, though with LLM assistance who knows. The imposition of the PO Token challenge in the various player clients looks like a plan being enacted. The 403 error with On a limited test, format 18 seems unaffected, which is a work-around even if eagle-eyed users find the content unsatisfactory. Presumably the change linked above will resolve the issue for some period. Maybe TV YT apps are less amenable to updating than mobile apps so that the period could be longer than a few days. |
For what it's worth... When youtube-dl stops working, I sitch to a version of yt-dlp, back-ported by nicolaasjan, which runs on my old system. I updated it yesterday, and so far it seems unaffected. All the formats seem to be downloading normally. I just downloaded a video with f136 video (720p) and f140 audio, and it worked fine. I know someone is going to ask why I don't just use yt-dlp all the time. Well, it's because the executable takes significantly longer to run than youtube-dl, and it seems more CPU intensive as well. Don't get me wrong, I'm grateful for it working at all, and to nicolaasjan for continuing to back-port it for older Windows versions, but I'd prefer to use youtube-dl if possible. |
What would be useful to know is which client is being used in your yt-dlp to fetch the successful formats, or even just the version. |
You mean the user agent? If so; Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 I've tried setting that with youtube-dl, but it didn't work. Here's a verbose log from a successful download of formats 136+140. I trimmed out the download progress messages as I don't think they add any useful information. [debug] Command-line config: ['-f', '136+140', '--verbose', 'https://www.youtube.com/watch?v=Kr2HK_rurho']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out cp1252 (No VT), error cp1252 (No VT), screen cp1252 (No VT)
[debug] yt-dlp version nicolaasjan/[email protected] (win_x86_exe)
[debug] Python 3.9.13 (CPython x86 32bit) - Windows-XP-5.1.2600-SP3 (OpenSSL 3.1.0-dev )
[debug] exe versions: ffmpeg N-105053-gc417616-Reino (fdk,setts)
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.12.14, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.3.0, websockets-14.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1838 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=Kr2HK_rurho
[youtube] Kr2HK_rurho: Downloading webpage
[youtube] Kr2HK_rurho: Downloading ios player API JSON
[youtube] Kr2HK_rurho: Downloading tv player API JSON
[debug] [youtube] Kr2HK_rurho: ios client https formats require a PO Token which was not provided. They will be skipped as they may yield HTTP Error 403. You can manually pass a PO Token for this client with --extractor-args "youtube:po_token=ios+XXX". For more information, refer to https://github.com/yt-dlp/yt-dlp/wiki/Extractors#po-token-guide . To enable these broken formats anyway, pass --extractor-args "youtube:formats=missing_pot"
[debug] Loading youtube-nsig.0b866fa6 from cache
[debug] [youtube] Decrypted nsig IvOwG2rTNL5Orb1Q => A4jDbUJHBHLyuA
[debug] Loading youtube-nsig.0b866fa6 from cache
[debug] [youtube] Decrypted nsig h3jEqmKeskuN_LYY => 5dSpnmMjse0SUw
[youtube] Kr2HK_rurho: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec, channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] Kr2HK_rurho: Downloading 1 format(s): 136+140
[debug] Invoking http downloader on "https://rr1---sn-j5caxoxu-i2o6.googlevideo.com/videoplayback?expire=1736926632&ei=SBGHZ8iLMpS_kucP6ouW8Q0&ip=24.44.111.244&id=o-ALvcXKFpKQJXy7R9zD9zLiRURZVO0OnnJ6pr8SXGVc7V&itag=136&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C271%2C278%2C313&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736905032%2C&mh=8S&mm=31%2C29&mn=sn-j5caxoxu-i2o6%2Csn-ab5l6nrl&ms=au%2Crdu&mv=m&mvi=1&pl=22&rms=au%2Cau&pcm2=yes&initcwndbps=3556250&bui=AY2Et-Ny3JQYIiRnlYQ49mAq_QD9ae_QP4PJQgXTtVamra5mVciXtcG8W2s3zMw_C85FRDAw_VA-NEH4&vprv=1&svpuc=1&mime=video%2Fmp4&ns=8iJSBIDlyLyK1XvWCsmqDoEQ&rqh=1&gir=yes&clen=20235034&dur=556.088&lmt=1723822885300421&mt=1736904531&fvip=2&keepalive=yes&lmw=1&fexp=51326932%2C51335594%2C51353498%2C51371294&c=TVHTML5&sefc=1&txp=4432434&n=5dSpnmMjse0SUw&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRgIhAIAfDmgmrYKPzmdhLPCxmJP_3WbfEOTranF-ZkgBzlhfAiEA5VfpXrDBmx4fIN6UfE2LV6dl9PndLknjm8BsaV9g8Go%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAJ1kymnlV12fg9xybnWrBjZpvQ0ZRc1xSwPVmnhIQkZwAiEApokKXnmQDP7RIxd9Yxtdfs0WaWsRg6at6l9Fep7jEOg%3D"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].f136.mp4
[download] 100% of 19.30MiB in 00:00:04 at 4.01MiB/s
[debug] Invoking http downloader on "https://rr1---sn-j5caxoxu-i2o6.googlevideo.com/videoplayback?expire=1736926632&ei=SBGHZ8iLMpS_kucP6ouW8Q0&ip=24.44.111.244&id=o-ALvcXKFpKQJXy7R9zD9zLiRURZVO0OnnJ6pr8SXGVc7V&itag=140&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736905032%2C&mh=8S&mm=31%2C29&mn=sn-j5caxoxu-i2o6%2Csn-ab5l6nrl&ms=au%2Crdu&mv=m&mvi=1&pl=22&rms=au%2Cau&pcm2=yes&initcwndbps=3556250&bui=AY2Et-Ny3JQYIiRnlYQ49mAq_QD9ae_QP4PJQgXTtVamra5mVciXtcG8W2s3zMw_C85FRDAw_VA-NEH4&vprv=1&svpuc=1&mime=audio%2Fmp4&ns=8iJSBIDlyLyK1XvWCsmqDoEQ&rqh=1&gir=yes&clen=9001818&dur=556.141&lmt=1723814198052623&mt=1736904531&fvip=2&keepalive=yes&lmw=1&fexp=51326932%2C51335594%2C51353498%2C51371294&c=TVHTML5&sefc=1&txp=4432434&n=5dSpnmMjse0SUw&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAPwt25P1coSz32ApBjagdsqC7b55D4Kfi2YeoCpiP6EiAiA7fcvPndNxBgpnkZGKGGGjiAJadkquHjMKeX2ayYFFDw%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAJ1kymnlV12fg9xybnWrBjZpvQ0ZRc1xSwPVmnhIQkZwAiEApokKXnmQDP7RIxd9Yxtdfs0WaWsRg6at6l9Fep7jEOg%3D"
[download] Destination: Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].f140.m4a
[download] 100% of 8.58MiB in 00:00:02 at 3.54MiB/s
[Merger] Merging formats into "Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i "file:Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].f136.mp4" -i "file:Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].f140.m4a" -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart "file:Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].temp.mp4"
Deleting original file Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].f136.mp4 (pass -k to keep)
Deleting original file Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW [Kr2HK_rurho].f140.m4a (pass -k to keep) |
OK, so that's the version (2025.01.13) with the commit linked above, selecting the |
Seems to work (for now...). 😀️ youtube-dl -v Kr2HK_rurho
[debug] System config: []
[debug] User config: ['--rm-cache-dir', '-i', '-o', '/dev/shm/test-ytd/%(title)s.%(ext)s', '-f', 'bestvideo[height<=1080][ext=mp4][vcodec^=avc]+bestaudio[ext=m4a]/best[ext=mp4]/best', '--no-mtime', '--embed-thumbnail', '--force-ipv4', '--cookies', 'cookies.txt']
[debug] Custom config: []
[debug] Command-line args: ['-v', 'Kr2HK_rurho']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2025.01.15
[debug] Lazy loading extractors enabled
[debug] Single file build
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-130-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg N-118301-g851a84650e-20250113, ffprobe N-118301-g851a84650e-20250113, rtmpdump 2.4
[debug] Proxy map: {}
Removing cache dir /home/nico/.cache/youtube-dl ...
[youtube] Kr2HK_rurho: Downloading webpage
[youtube] Kr2HK_rurho: Downloading TVHTML5 API JSON
[youtube] Kr2HK_rurho: Downloading player 0b866fa6
[debug] [youtube] Decrypted nsig 9vuc06WSd4g24q8A => DPutHL0F5FYkWg
[debug] [youtube] Decrypted nsig s_8NWKjE4rk4adH2 => OE7n8z9PYILITg
[youtube] Kr2HK_rurho: Downloading thumbnail ...
[youtube] Kr2HK_rurho: Writing thumbnail to: /dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.jpg
[debug] Invoking downloader on 'https://rr3---sn-5hnekn7s.googlevideo.com/videoplayback?expire=1736949572&ei=5GqHZ6rgNvLk6dsPyYSK4A0&ip=<REDACTED>&id=o-AHQ9OKCt35TIK6j3mo2nkCihKSYoT0hy5h_6F-Y0ymNe&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C271%2C278%2C313&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736927972%2C&mh=8S&mm=31%2C26&mn=sn-5hnekn7s%2Csn-4g5edndl&ms=au%2Conr&mv=m&mvi=3&pl=16&rms=au%2Cau&initcwndbps=3952500&bui=AY2Et-NwxkxjCFIZmFEtJMYI1Cwk5sbZDRvM6kBI2AhoNo8pRLpOMR59Q2igMZt0k1vILq7RYAnduz3E&spc=9kzgDffBRsJBZa5o&vprv=1&svpuc=1&mime=video%2Fmp4&ns=joR9vUnT9ELW1s8t3MW4kS8Q&rqh=1&gir=yes&clen=70654451&dur=556.088&lmt=1723822457414094&mt=1736927562&fvip=2&keepalive=yes&lmw=1&fexp=51326932%2C51335594%2C51353498%2C51371294&c=TVHTML5&sefc=1&txp=4432434&n=OE7n8z9PYILITg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAPMj7Cr8dhmJcTGPIN21h7D-RhiMRLmD147XijDBKGB8AiBu9XD3swNxXOfFU_t6H94qKVWAtxYB60M5HabdRzDvag%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgaj24HT0Hp3juHAnVyo0Law7tMeJLNfy8kaDl1vXYwYcCICkMvUBo7HQbGii6AIdYboRHr07cGtvc_1-DhNKdowOy'
[dashsegments] Total fragments: 7
[download] Destination: /dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.f137.mp4
[download] 100% of 67.38MiB in 00:03
[debug] Invoking downloader on 'https://rr3---sn-5hnekn7s.googlevideo.com/videoplayback?expire=1736949572&ei=5GqHZ6rgNvLk6dsPyYSK4A0&ip=<REDACTED>&id=o-AHQ9OKCt35TIK6j3mo2nkCihKSYoT0hy5h_6F-Y0ymNe&itag=140&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736927972%2C&mh=8S&mm=31%2C26&mn=sn-5hnekn7s%2Csn-4g5edndl&ms=au%2Conr&mv=m&mvi=3&pl=16&rms=au%2Cau&initcwndbps=3952500&bui=AY2Et-NwxkxjCFIZmFEtJMYI1Cwk5sbZDRvM6kBI2AhoNo8pRLpOMR59Q2igMZt0k1vILq7RYAnduz3E&spc=9kzgDffBRsJBZa5o&vprv=1&svpuc=1&xtags=drc%3D1&mime=audio%2Fmp4&ns=joR9vUnT9ELW1s8t3MW4kS8Q&rqh=1&gir=yes&clen=9001872&dur=556.141&lmt=1723814401078158&mt=1736927562&fvip=2&keepalive=yes&lmw=1&fexp=51326932%2C51335594%2C51353498%2C51371294&c=TVHTML5&sefc=1&txp=4432434&n=OE7n8z9PYILITg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cxtags%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhALjrFcK7Qos_Z4F4w7sevgH8tSonlKDObtq_TrbvL5dPAiApjd0guW_eH0zjlVs9zMp4CDKuxyfNMYQwVkGwqmKgmw%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgaj24HT0Hp3juHAnVyo0Law7tMeJLNfy8kaDl1vXYwYcCICkMvUBo7HQbGii6AIdYboRHr07cGtvc_1-DhNKdowOy'
[dashsegments] Total fragments: 1
[download] Destination: /dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.m4a.f140-drc.m4a
[download] 100% of 8.58MiB in 00:01
[ffmpeg] Merging formats into "/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.f137.mp4' -i 'file:/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.m4a.f140-drc.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.temp.mp4'
Deleting original file /dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.f137.mp4 (pass -k to keep)
Deleting original file /dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.m4a.f140-drc.m4a (pass -k to keep)
[ffmpeg] Adding thumbnail to "/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.mp4' -i 'file:/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.jpg' -c copy -map 0 -map 1 -disposition:v:1 attached_pic 'file:/dev/shm/test-ytd/Commodore Amiga 500 - ACA500+ Accelerator Card - FULL REVIEW.temp.mp4'
|
Only issues when also passing cookies... |
On 15/01/2025 18:08, nicolaasjan wrote:
Only issues when also passing cookies...
See: Issue #12085 <yt-dlp/yt-dlp#12085> (yt-dlp).
This shouldn't affect the build you showed, because `web_creator` was
never used in the first place.
|
@dirkf |
That makes sense. But we don't have a general way to detect |
At this point, all HTTP and DASH formats except |
Sadly no |
With 2025.01.06, some videos give 403, others don't. What doesn't gives 403:
What does:
Using an user agent doesn't seem to resolve/work it around, though |
2025.01.06 won't generally download successfully, except format 18, because of #32905 (comment). You may also get #32960, with that version and with 2025.01.16 at least. Try the new version from last night. |
I can confirm that the last video example from @FMecha works with the youtube-dl version built from the latest master: youtube-dl -vF BYJTrtMg9qg
[debug] System config: []
[debug] User config: ['--rm-cache-dir', '-i', '-o', '/dev/shm/test-ytd/%(title)s.%(ext)s', '-f', 'bestvideo[height<=1080][ext=mp4][vcodec^=avc]+bestaudio[ext=m4a]/best[ext=mp4]/best', '--no-mtime', '--embed-thumbnail', '--force-ipv4']
[debug] Custom config: []
[debug] Command-line args: ['-vF', 'BYJTrtMg9qg']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2025.01.20
[debug] Lazy loading extractors enabled
[debug] Single file build
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-130-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg N-118328-g504df09c34-20250120, ffprobe N-118328-g504df09c34-20250120, rtmpdump 2.4
[debug] Proxy map: {}
Removing cache dir /home/user/.cache/youtube-dl ...
[youtube] BYJTrtMg9qg: Downloading webpage
[youtube] BYJTrtMg9qg: Downloading TVHTML5 API JSON
[debug] [youtube] Extracting signature function js_6e1dd460_111
[youtube] BYJTrtMg9qg: Downloading player 6e1dd460
[debug] [youtube] Decrypted nsig I6jHYdh1q7OtXBjbU => kHJxeNV2EADScg
[debug] [youtube] Decrypted nsig o0TCe4UJHwfraViui => JBxzipOBdw19bQ
[debug] [youtube] Extracting signature function js_6e1dd460_107
[info] Available formats for BYJTrtMg9qg:
format code extension resolution note
249 webm audio only audio_quality_low 51k , webm_dash container, opus (48000Hz), 1.51MiB
250 webm audio only audio_quality_low 69k , webm_dash container, opus (48000Hz), 2.02MiB
140 m4a audio only audio_quality_medium 129k , m4a_dash container, mp4a.40.2 (44100Hz), 3.78MiB
251 webm audio only audio_quality_medium 135k , webm_dash container, opus (48000Hz), 3.96MiB
160 mp4 256x128 144p 39k , mp4_dash container, avc1.4d400c, 30fps, video only, 1.15MiB
394 mp4 256x128 144p 52k , mp4_dash container, av01.0.00M.08, 30fps, video only, 1.54MiB
278 webm 256x128 144p 65k , webm_dash container, vp9, 30fps, video only, 1.93MiB
395 mp4 426x188 240p 65k , mp4_dash container, av01.0.00M.08, 30fps, video only, 1.92MiB
133 mp4 426x188 240p 78k , mp4_dash container, avc1.4d400d, 30fps, video only, 2.28MiB
242 webm 426x188 240p 92k , webm_dash container, vp9, 30fps, video only, 2.70MiB
396 mp4 640x284 360p 114k , mp4_dash container, av01.0.01M.08, 30fps, video only, 3.33MiB
134 mp4 640x284 360p 140k , mp4_dash container, avc1.4d401e, 30fps, video only, 4.10MiB
243 webm 640x284 360p 200k , webm_dash container, vp9, 30fps, video only, 5.86MiB
397 mp4 854x378 480p 190k , mp4_dash container, av01.0.04M.08, 30fps, video only, 5.57MiB
135 mp4 854x378 480p 242k , mp4_dash container, avc1.4d401e, 30fps, video only, 7.07MiB
244 webm 854x378 480p 279k , webm_dash container, vp9, 30fps, video only, 8.16MiB
398 mp4 1280x566 720p 327k , mp4_dash container, av01.0.05M.08, 30fps, video only, 9.56MiB
136 mp4 1280x566 720p 440k , mp4_dash container, avc1.4d401f, 30fps, video only, 12.87MiB
247 webm 1280x566 720p 504k , webm_dash container, vp9, 30fps, video only, 14.72MiB
399 mp4 1920x850 1080p 560k , mp4_dash container, av01.0.08M.08, 30fps, video only, 16.35MiB
248 webm 1920x850 1080p 814k , webm_dash container, vp9, 30fps, video only, 23.77MiB
137 mp4 1920x850 1080p 1152k , mp4_dash container, avc1.640028, 30fps, video only, 33.64MiB
400 mp4 2560x1134 1440p 1498k , mp4_dash container, av01.0.12M.08, 30fps, video only, 43.73MiB
271 webm 2560x1134 1440p 2082k , webm_dash container, vp9, 30fps, video only, 60.79MiB
401 mp4 3840x1700 2160p 2816k , mp4_dash container, av01.0.12M.08, 30fps, video only, 82.22MiB
313 webm 3840x1700 2160p 5765k , webm_dash container, vp9, 30fps, video only, 168.29MiB
18 mp4 640x284 360p 412k , avc1.42001E, 30fps, mp4a.40.2 (44100Hz), 12.04MiB (best)
|
When testing nowadays, there are 3 things to check rather than the 1 that used to be enough:
|
@nicolaasjan wrote:
... But have you actually attempted a download? 😉
yt-dl -vf 136+140 "BYJTrtMg9qg" =>
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ffmpeg-location', '.\\FFmpeg', '--external-downloader-args', '-v 8 -stats', '-vf', '136+140', 'BYJTrtMg9qg']
[debug] Encodings: locale cp1253, fs mbcs, out cp737, pref cp1253
[debug] youtube-dl version 2025.01.21 [63fb0fc41] (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 3.4.4 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 - OpenSSL 1.0.2d 9 Jul 2015
[debug] exe versions: ffmpeg n6.1-dev-2615-N-112499-ga76b409, ffprobe n6.1-dev-2615-N-112499-ga76b409, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] BYJTrtMg9qg: Downloading webpage
[youtube] BYJTrtMg9qg: Downloading TVHTML5 API JSON
[debug] [youtube] Extracting signature function js_6e1dd460_107
[debug] [youtube] Decrypted nsig Bzj_i0DDUpTWKisyb => ESh-TZPMvAWdlA
[debug] [youtube] Extracting signature function js_6e1dd460_111
[debug] [youtube] Decrypted nsig k_Of0XWt67DI45jTC => kjA6Odff7elycA
[debug] Invoking downloader on 'https://rr1---sn-4vguioxu-n3bz.googlevideo.com/videoplayback?mime=video%2Fmp4&mm=31%2C29&sefc=1&svpuc=1&met=1737510463%2C&rms=au%2Cau&dur=244.844&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&fvip=1&mn=sn-4vguioxu-n3bz%2Csn-nv47lnsk&fexp=51326932%2C51335594%2C51353498%2C51355912%2C51371294%2C51384461&ms=au%2Crdu&gir=yes&pl=18&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C271%2C278%2C313%2C394%2C395%2C396%2C397%2C398%2C399%2C400%2C401&ns=bj_li9XlU0Nhvib2F2yx7PcQ&keepalive=yes&source=youtube&clen=13495911&mv=m&ei=P06QZ9q6LIPsi9oPpMve6Q0&n=kjA6Odff7elycA&itag=136&mt=1737510061&lmt=1731107774736890&spc=9kzgDZ4367xx299ZGbO-J0D9bYk1m_Ks5vmSViqZSB8u0lVIea52k0WCUfQNtUUaOnfOrV0&xpc=EgVo2aDSNQ%3D%3D&vprv=1&lsig=AGluJ3MwRQIhALooqK491zjaOCtZGeyvwA3wjCgMVukg6P4-HFPmnOtyAiAatt8LLCmqz4uMM8_qofNr0KoNQyJbjlO8EwJwHDkCeQ%3D%3D&ip=REDACTED&c=WEB&requiressl=yes&id=o-AFG-FRUxP16g72HfV-_X05srZFahAUV-OLbu-Q993Krg&expire=1737532063&rqh=1&sig=AJfQdSswRgIhAPtpUL34tNPO8hYAxWsHluVcJYGbazqfLSVxaWK0BmCnAiEAvoQERBqd939CiiEjCIwGelTU276a6OuT4aFu6zyqb3k%3D&initcwndbps=1321250&bui=AY2Et-NROzskx6UXLGPzCqYUwuZPqqjdbAFTMxTZN4bHVixLd5bYkUUi-5YE0a6tJG0QH-6QQxNOTdEK&mh=0S&mvi=1&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt'
[dashsegments] Total fragments: 2
[download] Destination: Glenn Fredly & Andi Rianto - Dibalas Dengan Dusta (Official Music Video)-BYJTrtMg9qg.f136.mp4
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 4 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 5 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 6 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 7 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 8 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 9 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 10 of 10)...
ERROR: giving up after 10 fragment retries
File "__main__.py", line 19, in <module>
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\__init__.py", line 477, in main
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\__init__.py", line 467, in _real_main
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 2258, in download
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 872, in extract_info
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 879, in wrapper
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 986, in __extract_info
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 1020, in process_ie_result
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 1864, in process_video_result
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 142, in wrapper
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 2156, in process_info
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 2092, in dl
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\downloader\common.py", line 380, in download
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\downloader\dash.py", line 78,in real_download
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\downloader\common.py", line 175, in report_error
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 682, in report_error
File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 634, in trouble ... so the answer is NO here 😢 ... |
That's because some idiot regression was introduced that gives you the |
@Rekrullurker posted
That's because the sign-in error comes when fetching the JSON containing the download links. The nsig challenge, which can take seconds, is executed only when processing those links. |
The |
Oops... |
... Thanks a bunch 👍 ; can confirm that the latest nightly can indeed complete a download attempt: yt-dl -f 136+140 "BYJTrtMg9qg" =>
[youtube] BYJTrtMg9qg: Downloading webpage
[youtube] BYJTrtMg9qg: Downloading TVHTML5 API JSON
[youtube] BYJTrtMg9qg: Downloading player 37364e28
[dashsegments] Total fragments: 2
[download] Destination: Glenn Fredly & Andi Rianto - Dibalas Dengan Dusta (Official Music Video)-BYJTrtMg9qg.f136.mp4
[download] 100% of 12.87MiB in 00:10
[dashsegments] Total fragments: 1
[download] Destination: Glenn Fredly & Andi Rianto - Dibalas Dengan Dusta (Official Music Video)-BYJTrtMg9qg.m4a.f140.m4a
[download] 100% of 3.78MiB in 00:03
[ffmpeg] Merging formats into "Glenn Fredly & Andi Rianto - Dibalas Dengan Dusta (Official Music Video)-BYJTrtMg9qg.mp4"
Deleting original file Glenn Fredly & Andi Rianto - Dibalas Dengan Dusta (Official Music Video)-BYJTrtMg9qg.f136.mp4 (pass -k to keep)
Deleting original file Glenn Fredly & Andi Rianto - Dibalas Dengan Dusta (Official Music Video)-BYJTrtMg9qg.m4a.f140.m4a (pass -k to keep) 😄 |
Checklist
Verbose log
Description
youtube-dl 'https://www.youtube.com/watch?v=lLSkbZ3-EOs'
The text was updated successfully, but these errors were encountered: