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

[Youtube] Got server error HTTP Error 403: Forbidden(latest master version) #32905

Open
6 tasks done
Linux2010 opened this issue Aug 8, 2024 · 126 comments
Open
6 tasks done
Labels
broken-IE problem with existing site extraction

Comments

@Linux2010
Copy link

Linux2010 commented Aug 8, 2024

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2024.08.07(the latest master version)
  • 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

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2024.08.07.local
[debug] Python 3.8.5 (CPython x86_64 64bit) - macOS-10.16-x86_64-i386-64bit - OpenSSL 1.1.1h  22 Sep 2020
[debug] exe versions: ffmpeg 7.0.1-tessus, ffprobe 6.1.1, rtmpdump 2.4
[debug] Proxy map: {'http': 'http://127.0.0.1:58309', 'https': 'http://127.0.0.1:58309'}
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

PASTE VERBOSE LOG HERE

Description

  • The download will run normally for a short time, and then a 403 error will appear
youtube-dl 'https://www.youtube.com/watch?v=lLSkbZ3-EOs'
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 4 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 5 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 6 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 7 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 8 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 9 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 41 (attempt 10 of 10)...
[download] Skipping fragment 41...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 42 (attempt 1 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 42 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 42 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 42 (attempt 4 of 10)...
@Linux2010 Linux2010 changed the title reoporting bug :Got server HTTP error: HTTP Error 403: Forbidden(the least version) reoporting bug :Got server HTTP error: HTTP Error 403: Forbidden(the latest version) Aug 8, 2024
@Linux2010 Linux2010 changed the title reoporting bug :Got server HTTP error: HTTP Error 403: Forbidden(the latest version) reoporting bug :Got server HTTP error: HTTP Error 403: Forbidden(the latest master version) Aug 8, 2024
@dirkf
Copy link
Contributor

dirkf commented Aug 8, 2024

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?

@dirkf dirkf changed the title reoporting bug :Got server HTTP error: HTTP Error 403: Forbidden(the latest master version) [Youtube]: Got server error HTTP Error 403: Forbidden(latest master version) Aug 8, 2024
@dirkf dirkf changed the title [Youtube]: Got server error HTTP Error 403: Forbidden(latest master version) [Youtube] Got server error HTTP Error 403: Forbidden(latest master version) Aug 8, 2024
@tansy
Copy link

tansy commented Aug 8, 2024

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.

@dirkf
Copy link
Contributor

dirkf commented Aug 8, 2024

So

  1. poToken (I agree, this is always being detected today) randomly breaks the download rather than uniformly giving 403 as with the revised n-sig "throttling"?
  2. different clients get more or less functional links for formats with the same itag?

@GregoriusT
Copy link

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... >.>

@dirkf
Copy link
Contributor

dirkf commented Aug 8, 2024

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:

  1. actually ignore the data with poToken and use the existing "punt to API" logic with a selected unafflicted client.
  2. extend to user-specified other, or selection of, clients similar to the yt-dlp extractor logic.

@iactix
Copy link

iactix commented Aug 8, 2024

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.

@tansy
Copy link

tansy commented Aug 9, 2024

This change is significant. I checked old, pre quantum Firefox and videos don't work any more, when 3 days ago they did.

@dirkf
Copy link
Contributor

dirkf commented Aug 9, 2024

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?

@tansy
Copy link

tansy commented Aug 9, 2024

It used to work as embedded or as mobile (when used mobile user agent). Now all of them display all saying error:

An error occurred. Please try again later. (Playback ID: j-bZsC_YehYVyZZ8)
Learn More (https://support.google.com/youtube/?p=player_error1&hl=en)

Loading any video at https://www.youtube.com/embed/1234567890a:

Content Security Policy: Couldn't process unknown directive 'require-trusted-types-for' <unknown>
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create www-embed-player.js:26:77
InvalidStateError www-embed-player.js:1128:42

Then pressing play:

Error: WebGL: Error during native OpenGL init. base.js:11283:169
Error: WebGL: WebGL creation failed. base.js:11283:169

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

Content Security Policy: Couldn't process unknown directive 'require-trusted-types-for' <unknown>
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create www-embed-player.js:26:77
InvalidStateError www-embed-player.js:1128:42
Empty string passed to getElementById(). zVhcVoOEv7o line 2 > eval:795:28944

Error: WebGL: getParameter: parameter: invalid enum value <enum 0x9246> base.js:11283:254

This one does and, with this log:

Content Security Policy: Couldn't process unknown directive 'require-trusted-types-for' <unknown>
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create www-embed-player.js:26:77
InvalidStateError www-embed-player.js:1128:42
Empty string passed to getElementById(). KAR4fAX5T7Y line 2 > eval:4650:33869

So, after clicking 'play' it gives this error: Error: WebGL: getParameter: parameter: invalid enum value <enum 0x9246> base.js:11283:254.

@TheHolyRoger
Copy link

TheHolyRoger commented Aug 9, 2024

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 cpns (nonces) and adding them to the format fragment URLs without any luck as well as using rn (request numbers) in the URL query instead of byte ranges. Have tried sleeping between fragments to mimick video playback also without joy.

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 /videoplayback fragment URLs above 1Meg without any issue...

@dirkf
Copy link
Contributor

dirkf commented Aug 9, 2024

But in the browser the media links have the pot parameter with its poToken challenge result, no? Which is what we can't haz.

In line with step 1 above, I'm gradually pulling stuff from the yt-dlp extractor, enough to download HLS with client ios, but plainly not yet enough to get unblocked links from tv or web_creator, eg with format 135. Should I be expecting that?

@TheHolyRoger
Copy link

TheHolyRoger commented Aug 9, 2024

But in the browser the media links have the pot parameter with its poToken challenge result, no? Which is what we can't haz.

In line with step 1 above, I'm gradually pulling stuff from the yt-dlp extractor, enough to download HLS with client ios, but plainly not yet enough to get unblocked links from tv or web_creator, eg with format 135. Should I be expecting that?

I'm not seeing a pot parameter in the query strings, I am seeing post data in the /videoplayback requests which is referred to in the source as playbackCookie

Edit: Looks like the playbackCookie / POST data is extracted from the bytes of the previous fragment response somehow

@8chanAnon
Copy link

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.

@dirkf
Copy link
Contributor

dirkf commented Aug 10, 2024

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 poToken is being sent in POST data by the browser in the Invidious code that shows how to capture the value. But I understood from yt-dlp discussions that a pot query parameter was used in the media links associated with the pot-ified session.

@8chanAnon's algorithm is what is currently done for age-gate videos, up to the last step with m.youtube.com which is new and interesting. What happens if you skip straight to that step?

Step 2 will only work if TVHTML5_SIMPLY_EMBEDDED_PLAYER is not pot-ified, and that seems to be in question.

@dirkf
Copy link
Contributor

dirkf commented Aug 10, 2024

Indeed, Android 14/FF 122 at m.youtube.com didn't list the poToken experiment IDs although yt-dlp has reported unsuccess with Android clients.

@TheHolyRoger
Copy link

TheHolyRoger commented Aug 10, 2024

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 base.js when I get some time trying to understand how the token is created, it does seem to be extracted from the bytes of at least the first video fragment as far as I can tell, but not all fragments?...

There's a Uint8Array which appears to be the fragment response data?... manipulated several times and then 82/84/68 bytes of that array are stored as playbackCookie which is then sent in the POST data

@dirkf

This comment was marked as outdated.

@PatrickJRed
Copy link

PatrickJRed commented Aug 10, 2024

@dirkf

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?

On a lot of websites I want to download from youtube-dl and curl dont even get the correct html,
instead of the one i would get in my Browser , they receives a version that has the captcha.

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.
A lot of the problems I had with 403 errors in youtube-dl where captchas triggered by http-client not being exactly like an official version of firefox or chrome :) (this might even be valid for fragment-downloads)

@dirkf
Copy link
Contributor

dirkf commented Aug 10, 2024

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 poToken issue, a dependency running under Docker would not be an acceptable solution for the main functionality of the program, though it might be a PoC for a solution.

@TheHolyRoger

This comment was marked as resolved.

@PatrickJRed

This comment was marked as off-topic.

@Rekrullurker

This comment was marked as outdated.

@dirkf

This comment was marked as outdated.

@dirkf
Copy link
Contributor

dirkf commented Dec 13, 2024

Testing shows that the DASH formats from the mobile web client are failing, regardless of their origin. The same formats extracted by yt-dlp stable are OK, in a test setup using ffmpeg as downloader in each case.

The test code is #32987

adapted to use the player_response from an API call using MWEB client

            ...
            origin = 'https://m.youtube.com'
            pb_context = {'html5Preference': 'HTML5_PREF_WANTS'}

            player_url = self._extract_player_url(webpage)
            ytcfg = self._extract_ytcfg(video_id, webpage)
            sts = self._extract_signature_timestamp(video_id, player_url, ytcfg)
            if sts:
                pb_context['signatureTimestamp'] = sts

            query = {
                'playbackContext': {
                    'contentPlaybackContext': pb_context,
                    'contentCheckOk': True,
                    'racyCheckOk': True,
                },
                'context': {
                    'client': {
                        'clientName': 'MWEB',
                        'clientVersion': '2.20240726.01.00',
                        'hl': 'en',
                    },
                },
                'videoId': video_id,
            }
            headers = {
                'X-YouTube-Client-Name': '2',
                'X-YouTube-Client-Version': '2.0',
                'Origin': origin,
            }

            auth = self._generate_sapisidhash_header(origin)
            if auth is not None:
                headers['Authorization'] = auth
                headers['X-Origin'] = origin

            player_response = self._call_api('player', query, video_id, fatal=False, headers=headers)
            ...

These things are not enough to avoid 403 with #32987 adapted to use the player_response from an API call using MWEB client:

  • same UA in download
  • Sec-Fetch-Mode: navigate in download headers.

In at least one case the failing media URL had a spc query param not present in the successful media URL while lsig was present in the successful URL and not in the failing one, with other query params the same (not all the same values, because times and nsigs, etc, change)

@dirkf
Copy link
Contributor

dirkf commented Dec 14, 2024

Apparently the client parameters, including UA, need to be just right.

A temporary fix (that worked today)is included in PR #32987.

@dirkf
Copy link
Contributor

dirkf commented Dec 17, 2024

Please try https://github.com/ytdl-org/ytdl-nightly/releases/tag/2024.12.17 to resolve this issue for now.

ledav-net added a commit to ledav-net/youtube-mp3 that referenced this issue Dec 25, 2024
@gleeglee217
Copy link

Wow it works! 24.12.17 but for how long? Thanks dirkf ! You have go fundme or something lol

@dirkf
Copy link
Contributor

dirkf commented Dec 28, 2024

LoL, but if you want, pay back to an open source program in some way, or somehow help a local charity.

Also, review #32960 for guidance on how to avoid further breakage.

@Rekrullurker

This comment was marked as duplicate.

@dirkf
Copy link
Contributor

dirkf commented Jan 9, 2025

Per #33018, this issue is now recurring, with various player JS, though not with format 18, essentially back to the state at #32905 (comment):

$ python3.9 -m youtube_dl -v -f 137 'https://www.youtube.com/watch?v=MqyZfibp07o'[debug] System config: ['--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', '137', 'https://www.youtube.com/watch?v=MqyZfibp07o']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 1036478d1
[debug] Python 3.9.21 (CPython i686 32bit) - Linux-4.4.0-210-generic-i686-with-glibc2.23 - OpenSSL 1.1.1w  11 Sep 2023 - glibc 2.23
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] MqyZfibp07o: Downloading webpage
[youtube] MqyZfibp07o: Downloading API JSON
[debug] [youtube] Decrypted nsig FhrJPUatObxYK8Rv => vdEPuvWCK9YF7
[debug] [youtube] Decrypted nsig c39LBljb5RB6QKSg => 9Ngcwo0LzFTVx
[debug] Invoking downloader on 'https://rr4---sn-cu-aigss.googlevideo.com/videoplayback?expire=1736460690&ei=MvV_Z9njHcTFhcIPzsXIsQw&ip=46.208.6.43&id=o-AFICHuugxW07duGeQhcxyRFyZ8mExMCkVUQadrcnyrjz&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278%2C597%2C598&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736439090%2C&mh=ny&mm=31%2C29&mn=sn-cu-aigss%2Csn-cu-c9i6&ms=au%2Crdu&mv=m&mvi=4&pl=25&rms=au%2Cau&initcwndbps=3481250&bui=AfMhrI9IQbFD09jugoDiezFLtv_vSU-mL0lAjWrfqVHOywfv81wS-0OxKD6pCCgba8F0W_onQJ20KvMJ&spc=x-caUF4NRFvEg-sb&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cO0N5BklTE7VjbUNkW2xKf0Q&rqh=1&gir=yes&clen=555866737&dur=3068.166&lmt=1736417214465510&mt=1736438723&fvip=5&keepalive=yes&fexp=51326932%2C51331020%2C51335594%2C51353497%2C51371294&c=MWEB&sefc=1&txp=5535034&n=9Ngcwo0LzFTVx&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAKi5iQ8xYUUR5r_OKM3PHUfJmG91sVFYRqIL1pvqWA51AiAvh6XGoyHECgOQgl7HTcLFvU_I74ZaLaCRLJSDsBxToA%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAJP8BFRZ57OaIxXWHdfXqyHXhkSR7N-OWog_f8nuaHfjAiEAnQ0SdqHYBZ1jhitSo_u5CyNuEvumDEx7wSHTHhqadqE%3D'
[dashsegments] Total fragments: 54
[download] Destination: ถ่ายทอดสด รายการข่าว 3 มิติ วันที่ 8 มกราคม 2568-MqyZfibp07o.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 10 of 10)...
ERROR: giving up after 10 fragment retries
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/home/df/Documents/src/youtube-dl/youtube_dl/__init__.py", line 477, in main
    _real_main(argv)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/__init__.py", line 467, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 2222, in download
    res = self.extract_info(
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 881, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 888, in wrapper
    return func(self, *args, **kwargs)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 995, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 1029, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 1884, in process_video_result
    self.process_info(new_info)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 140, in wrapper
    return func(self, *args, **kwargs)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 2127, in process_info
    success = dl(filename, info_dict)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 2057, in dl
    return fd.download(name, new_info)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/downloader/dash.py", line 78, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 691, in report_error
    self.trouble(*args, **kwargs)
  File "/home/df/Documents/src/youtube-dl/youtube_dl/YoutubeDL.py", line 639, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

$

The equivalent yt-dlp command succeeds:

$ yt-dlp -v -f 137 --extractor-args 'youtube:player-client=mweb' 'https://www.youtube.com/watch?v=MqyZfibp07o'
[debug] Command-line config: ['-v', '-f', '137', '--extractor-args', 'youtube:player-client=mweb', 'https://www.youtube.com/watch?v=MqyZfibp07o']
[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.12.06 from yt-dlp/yt-dlp [4bd265539] (zip)
[debug] Python 3.9.21 (CPython i686 32bit) - Linux-4.4.0-210-generic-i686-with-glibc2.23 (OpenSSL 1.1.1w  11 Sep 2023, glibc 2.23)
[debug] exe versions: ffmpeg 4.3, ffprobe 4.3
[debug] Optional libraries: Cryptodome-3.11.0, certifi-2019.11.28, requests-2.25.1, secretstorage-3.2.0, sqlite3-3.37.2, urllib3-1.25.11
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1837 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=MqyZfibp07o
[youtube] MqyZfibp07o: Downloading webpage
[youtube] MqyZfibp07o: Downloading mweb player API JSON
[debug] Loading youtube-nsig.a5032d18 from cache
[debug] [youtube] Decrypted nsig FLm4oyWALZ46GGWf => sm12-JHmSOKnww
[debug] Loading youtube-nsig.a5032d18 from cache
[debug] [youtube] Decrypted nsig 3R_Ff_X45cd7bE5y => 188bfpfqz_aIgg
[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] MqyZfibp07o: Downloading 1 format(s): 137
[debug] Invoking http downloader on "https://rr4---sn-cu-aigss.googlevideo.com/videoplayback?expire=1736453314&ei=Yth_Z8ibKc3Dp-oPrpjIsQE&ip=46.208.6.43&id=o-AAk-qJPdjArNz09BZUyPwIVH2OV5AUQXRvtmPEGDbcT8&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278%2C597%2C598&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736431714%2C&mh=ny&mm=31%2C29&mn=sn-cu-aigss%2Csn-cu-c9i6&ms=au%2Crdu&mv=m&mvi=4&pl=25&rms=au%2Cau&initcwndbps=3366250&bui=AfMhrI9FckGzGU41FgTLKXZ866Ic4oCOGDWkG_tJiOUiLy4jwi2nZBKZxSWmGBd63LIfot2ZP5foBy0S&vprv=1&svpuc=1&mime=video%2Fmp4&ns=QHtbYg03vielmQj_-egUGdEQ&rqh=1&gir=yes&clen=555866737&dur=3068.166&lmt=1736417214465510&mt=1736431267&fvip=5&keepalive=yes&fexp=51326932%2C51331020%2C51335594%2C51353498%2C51371294&c=MWEB&sefc=1&txp=5535034&n=188bfpfqz_aIgg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAJxN7dsZuBmVvv0bCA17XlbR63MOTtMOK943D6G9OlJhAiAeKfv0GE8uHWc4rycSn-mGWciW8MtlYfRIxY0kEyyuFg%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgE9AVtKI4ie5fKX9qjw2LS8ca7vx8xjSfrA_2QFe3whQCIBzY6qLORyCiOQ2JGtoWiTEhlNI854gY7RfDk-e_Yuen"
[download] Destination: ถ่ายทอดสด รายการข่าว 3 มิติ วันที่ 8 มกราคม 2568 [MqyZfibp07o].mp4
[download]   1.2% of  530.12MiB at 1008.60KiB/s ETA 08:51^C
ERROR: Interrupted by user
$

Although the client parameters are the same, the download links have different query parameters, ignoring time, nonce and sig values: yt-dlp get a dur (duration), while yt-dl gets spc.

@dirkf
Copy link
Contributor

dirkf commented Jan 9, 2025

And now it's not, for the last 4 hours or so. Please report if you are getting 403 on download with the 2025.01 nightly releases and not using a VPN, data centre IP address, or otherwise provoking the site to block you.

@nicolaasjan
Copy link

Seems to be working again for now (own build from master):

youtube-dl -v https://www.youtube.com/watch?v=_ih1Ofn8k1s
[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: ['-v', 'https://www.youtube.com/watch?v=_ih1Ofn8k1s']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2025.01.06
[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-118242-gf80af3657f-20250105, ffprobe N-118242-gf80af3657f-20250105, rtmpdump 2.4
[debug] Proxy map: {}
Removing cache dir /home/nico/.cache/youtube-dl ...
[youtube] _ih1Ofn8k1s: Downloading webpage
[youtube] _ih1Ofn8k1s: Downloading API JSON
[youtube] _ih1Ofn8k1s: Downloading player 3ede36f2
[debug] [youtube] Decrypted nsig o4Qsvp5P9kLeX7hW2Q => sc7stUJPArCgpg
[debug] [youtube] Decrypted nsig WkAsFGr-zImqSOd3Tm => C2yQtDm1cQ0WvQ
[youtube] _ih1Ofn8k1s: Downloading thumbnail ...
[youtube] _ih1Ofn8k1s: Writing thumbnail to: /dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.jpg
[debug] Invoking downloader on 'https://rr1---sn-5hne6nzd.googlevideo.com/videoplayback?expire=1736512737&ei=gcCAZ_bxHLiPi9oPndXN0Qs&ip=<REDACTED>&id=o-AJTxm_nJRVp8Pz8dCG5bpNKcEqfYSd7Q9yLKAhpU_iGc&itag=299&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303%2C308%2C315%2C394%2C395%2C396%2C397%2C398%2C399%2C400%2C401%2C597%2C598&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736491137%2C&mh=sb&mm=31%2C26&mn=sn-5hne6nzd%2Csn-4g5ednss&ms=au%2Conr&mv=m&mvi=1&pl=16&rms=au%2Cau&initcwndbps=4620000&bui=AfMhrI9SoEwCTmxm4_39e7rgjeskGVJj-vqmooNpgxsZHjR6o0ulg0sLM-u95_NTYcjDOaIDre4fbHXa&spc=x-caUJCqdyTAoXDK&vprv=1&svpuc=1&mime=video%2Fmp4&ns=IfoYYCaT2-2OcodoFFgOuf0Q&rqh=1&gir=yes&clen=342699157&dur=653.283&lmt=1735967490890937&mt=1736490792&fvip=2&keepalive=yes&fexp=51326932%2C51331020%2C51335594%2C51353498%2C51371294&c=MWEB&sefc=1&txp=5532434&n=C2yQtDm1cQ0WvQ&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgJHGiT2AD4frWnDB9o0R97pff4xjd_UPU6_210d83QswCIQD-Q9m-u2kEmX1x9ymLUffxxQ6vTK_tm89-pzTeHXsPyA%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAMxE6QMxlpH9HNIwdD12ZOGizmguFJyA7147BPbU-cNRAiEAiDCzFNjzrAjq6TvMKqnZLkVR9Z3yvR6WMDjGzC1RTaw%3D'
[dashsegments] Total fragments: 33
[download] Destination: /dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.f299.mp4
[download] 100% of 326.82MiB in 00:13
[debug] Invoking downloader on 'https://rr1---sn-5hne6nzd.googlevideo.com/videoplayback?expire=1736512737&ei=gcCAZ_bxHLiPi9oPndXN0Qs&ip=<REDACTED>&id=o-AJTxm_nJRVp8Pz8dCG5bpNKcEqfYSd7Q9yLKAhpU_iGc&itag=140&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736491137%2C&mh=sb&mm=31%2C26&mn=sn-5hne6nzd%2Csn-4g5ednss&ms=au%2Conr&mv=m&mvi=1&pl=16&rms=au%2Cau&initcwndbps=4620000&bui=AfMhrI9SoEwCTmxm4_39e7rgjeskGVJj-vqmooNpgxsZHjR6o0ulg0sLM-u95_NTYcjDOaIDre4fbHXa&spc=x-caUJCqdyTAoXDK&vprv=1&svpuc=1&xtags=acont%3Doriginal%3Alang%3Den-US&mime=audio%2Fmp4&ns=IfoYYCaT2-2OcodoFFgOuf0Q&rqh=1&gir=yes&clen=10574806&dur=653.363&lmt=1735948614756042&mt=1736490792&fvip=2&keepalive=yes&fexp=51326932%2C51331020%2C51335594%2C51353498%2C51371294&c=MWEB&sefc=1&txp=5532434&n=C2yQtDm1cQ0WvQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cxtags%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgDz8Bd3QPTrSpJFrmUMienUCkM3onZ1uYFh582SXgp6ACIH7QMx-iSqNChn2bKB516rylex7xMJ8_xtlSFjolkjBr&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRgIhAMxE6QMxlpH9HNIwdD12ZOGizmguFJyA7147BPbU-cNRAiEAiDCzFNjzrAjq6TvMKqnZLkVR9Z3yvR6WMDjGzC1RTaw%3D'
[dashsegments] Total fragments: 2
[download] Destination: /dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.m4a.f140.m4a
[download] 100% of 10.08MiB in 00:00
[ffmpeg] Merging formats into "/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.f299.mp4' -i 'file:/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.m4a.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.temp.mp4'
Deleting original file /dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.f299.mp4 (pass -k to keep)
Deleting original file /dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.m4a.f140.m4a (pass -k to keep)
[ffmpeg] Adding thumbnail to "/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.mp4' -i 'file:/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.jpg' -c copy -map 0 -map 1 -disposition:v:1 attached_pic 'file:/dev/shm/test-ytd/Experimental Evidence of Photons Experiencing Negative Time.temp.mp4'

@dirkf
Copy link
Contributor

dirkf commented Jan 10, 2025

Probably a continuation of item 2 here.

@bashonly
Copy link
Contributor

yt-dlp/yt-dlp@712d2ab#diff-b7b9f6790de4427214b61939432e667d95b929d07fd918b9da1a36d7996cc506R259

@dirkf dirkf added the broken-IE problem with existing site extraction label Jan 13, 2025
@Rekrullurker
Copy link

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.

@dirkf
Copy link
Contributor

dirkf commented Jan 14, 2025

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 MWEB client is now reproducing here, both with the 2025 nightly builds and with MWEB formats in yt-dlp (unlike the previous 403 storm).

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.

@Rekrullurker
Copy link

Rekrullurker commented Jan 15, 2025

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.
.

@dirkf
Copy link
Contributor

dirkf commented Jan 15, 2025

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.

@Rekrullurker
Copy link

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/yt-dlp@2025.01.13.082735 (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)

@dirkf
Copy link
Contributor

dirkf commented Jan 15, 2025

OK, so that's the version (2025.01.13) with the commit linked above, selecting the tv InnerTube client, that I'm right now shoe-horning into yt-dl.

@nicolaasjan
Copy link

that I'm right now shoe-horning into yt-dl.

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'

@nicolaasjan
Copy link

Only issues when also passing cookies...
See: Issue #12085 (yt-dlp).

Comment

@dirkf
Copy link
Contributor

dirkf commented Jan 15, 2025 via email

@bashonly
Copy link
Contributor

@dirkf TVHTML5 never returns m3u8 formats, so for the sake of livestreams you may still want to extract the WEB m3u8 formats from the webpage. m3u8 formats do not require a pot param (for now).

@dirkf
Copy link
Contributor

dirkf commented Jan 15, 2025

That makes sense. But we don't have a general way to detect pot requirements for a given media URL other than bitter experience?

@bashonly
Copy link
Contributor

bashonly commented Jan 15, 2025

That makes sense. But we don't have a general way to detect pot requirements for a given media URL other than bitter experience?

At this point, all HTTP and DASH formats except 18 from all clients except tv, tv_embedded and web_embedded (yt-dlp's names for them) either have a pot param requirement or the requirement is being A/B tested.

@dirkf
Copy link
Contributor

dirkf commented Jan 16, 2025

Sadly no hlsManifestUrl is to be found in the tv API response (expected), nor in the webpage response, nor in the web API response. But it can be extracted from the ios response. Then a test video gets another 17 formats, making 40 altogether, or presumably just the number of HLS formats for a live stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken-IE problem with existing site extraction
Projects
None yet
Development

No branches or pull requests