yt-dlp 2025.12.1.233105.dev0__py3-none-any.whl → 2025.12.4.233042.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -704,6 +704,24 @@ class YoutubeWebArchiveIE(InfoExtractor):
704
704
  'thumbnail': 'https://web.archive.org/web/20160108040020if_/https://i.ytimg.com/vi/SQCom7wjGDs/maxresdefault.jpg',
705
705
  'upload_date': '20160107',
706
706
  },
707
+ }, {
708
+ # dmuxed formats
709
+ 'url': 'https://web.archive.org/web/20240922160632/https://www.youtube.com/watch?v=z7hzvTL3k1k',
710
+ 'info_dict': {
711
+ 'id': 'z7hzvTL3k1k',
712
+ 'ext': 'webm',
713
+ 'title': 'Praise the Lord and Pass the Ammunition (BARRXN REMIX)',
714
+ 'description': 'md5:45dbf2c71c23b0734c8dfb82dd1e94b6',
715
+ 'uploader': 'Barrxn',
716
+ 'uploader_id': 'TheRockstar6086',
717
+ 'uploader_url': 'https://www.youtube.com/user/TheRockstar6086',
718
+ 'channel_id': 'UCjJPGUTtvR9uizmawn2ThqA',
719
+ 'channel_url': 'https://www.youtube.com/channel/UCjJPGUTtvR9uizmawn2ThqA',
720
+ 'duration': 125,
721
+ 'thumbnail': r're:https?://.*\.(jpg|webp)',
722
+ 'upload_date': '20201207',
723
+ },
724
+ 'params': {'format': 'bv'},
707
725
  }, {
708
726
  'url': 'https://web.archive.org/web/http://www.youtube.com/watch?v=kH-G_aIBlFw',
709
727
  'only_matching': True,
@@ -1060,6 +1078,19 @@ class YoutubeWebArchiveIE(InfoExtractor):
1060
1078
  capture_dates.extend([self._OLDEST_CAPTURE_DATE, self._NEWEST_CAPTURE_DATE])
1061
1079
  return orderedSet(filter(None, capture_dates))
1062
1080
 
1081
+ def _parse_fmt(self, fmt, extra_info=None):
1082
+ format_id = traverse_obj(fmt, ('url', {parse_qs}, 'itag', 0))
1083
+ return {
1084
+ 'format_id': format_id,
1085
+ **self._FORMATS.get(format_id, {}),
1086
+ **traverse_obj(fmt, {
1087
+ 'url': ('url', {lambda x: f'https://web.archive.org/web/2id_/{x}'}),
1088
+ 'ext': ('ext', {str}),
1089
+ 'filesize': ('url', {parse_qs}, 'clen', 0, {int_or_none}),
1090
+ }),
1091
+ **(extra_info or {}),
1092
+ }
1093
+
1063
1094
  def _real_extract(self, url):
1064
1095
  video_id, url_date, url_date_2 = self._match_valid_url(url).group('id', 'date', 'date2')
1065
1096
  url_date = url_date or url_date_2
@@ -1090,17 +1121,14 @@ class YoutubeWebArchiveIE(InfoExtractor):
1090
1121
  info['thumbnails'] = self._extract_thumbnails(video_id)
1091
1122
 
1092
1123
  formats = []
1093
- for fmt in traverse_obj(video_info, ('formats', lambda _, v: url_or_none(v['url']))):
1094
- format_id = traverse_obj(fmt, ('url', {parse_qs}, 'itag', 0))
1095
- formats.append({
1096
- 'format_id': format_id,
1097
- **self._FORMATS.get(format_id, {}),
1098
- **traverse_obj(fmt, {
1099
- 'url': ('url', {lambda x: f'https://web.archive.org/web/2id_/{x}'}),
1100
- 'ext': ('ext', {str}),
1101
- 'filesize': ('url', {parse_qs}, 'clen', 0, {int_or_none}),
1102
- }),
1103
- })
1124
+ if video_info.get('dmux'):
1125
+ for vf in traverse_obj(video_info, ('formats', 'video', lambda _, v: url_or_none(v['url']))):
1126
+ formats.append(self._parse_fmt(vf, {'acodec': 'none'}))
1127
+ for af in traverse_obj(video_info, ('formats', 'audio', lambda _, v: url_or_none(v['url']))):
1128
+ formats.append(self._parse_fmt(af, {'vcodec': 'none'}))
1129
+ else:
1130
+ for fmt in traverse_obj(video_info, ('formats', lambda _, v: url_or_none(v['url']))):
1131
+ formats.append(self._parse_fmt(fmt))
1104
1132
  info['formats'] = formats
1105
1133
 
1106
1134
  return info
@@ -104,6 +104,7 @@ INNERTUBE_CLIENTS = {
104
104
  },
105
105
  'INNERTUBE_CONTEXT_CLIENT_NAME': 1,
106
106
  'SUPPORTS_COOKIES': True,
107
+ 'SUPPORTS_AD_PLAYBACK_CONTEXT': True,
107
108
  **WEB_PO_TOKEN_POLICIES,
108
109
  },
109
110
  # Safari UA returns pre-merged video+audio 144p/240p/360p/720p/1080p HLS formats
@@ -117,6 +118,7 @@ INNERTUBE_CLIENTS = {
117
118
  },
118
119
  'INNERTUBE_CONTEXT_CLIENT_NAME': 1,
119
120
  'SUPPORTS_COOKIES': True,
121
+ 'SUPPORTS_AD_PLAYBACK_CONTEXT': True,
120
122
  **WEB_PO_TOKEN_POLICIES,
121
123
  },
122
124
  'web_embedded': {
@@ -157,6 +159,7 @@ INNERTUBE_CLIENTS = {
157
159
  ),
158
160
  },
159
161
  'SUPPORTS_COOKIES': True,
162
+ 'SUPPORTS_AD_PLAYBACK_CONTEXT': True,
160
163
  },
161
164
  # This client now requires sign-in for every video
162
165
  'web_creator': {
@@ -313,6 +316,7 @@ INNERTUBE_CLIENTS = {
313
316
  ),
314
317
  },
315
318
  'SUPPORTS_COOKIES': True,
319
+ 'SUPPORTS_AD_PLAYBACK_CONTEXT': True,
316
320
  },
317
321
  'tv': {
318
322
  'INNERTUBE_CONTEXT': {
@@ -412,6 +416,7 @@ def build_innertube_clients():
412
416
  ytcfg.setdefault('SUBS_PO_TOKEN_POLICY', SubsPoTokenPolicy())
413
417
  ytcfg.setdefault('REQUIRE_AUTH', False)
414
418
  ytcfg.setdefault('SUPPORTS_COOKIES', False)
419
+ ytcfg.setdefault('SUPPORTS_AD_PLAYBACK_CONTEXT', False)
415
420
  ytcfg.setdefault('PLAYER_PARAMS', None)
416
421
  ytcfg.setdefault('AUTHENTICATED_USER_AGENT', None)
417
422
  ytcfg['INNERTUBE_CONTEXT']['client'].setdefault('hl', 'en')
@@ -2629,16 +2629,23 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
2629
2629
  return {'contentCheckOk': True, 'racyCheckOk': True}
2630
2630
 
2631
2631
  @classmethod
2632
- def _generate_player_context(cls, sts=None):
2632
+ def _generate_player_context(cls, sts=None, use_ad_playback_context=False):
2633
2633
  context = {
2634
2634
  'html5Preference': 'HTML5_PREF_WANTS',
2635
2635
  }
2636
2636
  if sts is not None:
2637
2637
  context['signatureTimestamp'] = sts
2638
+
2639
+ playback_context = {
2640
+ 'contentPlaybackContext': context,
2641
+ }
2642
+ if use_ad_playback_context:
2643
+ playback_context['adPlaybackContext'] = {
2644
+ 'pyv': True,
2645
+ }
2646
+
2638
2647
  return {
2639
- 'playbackContext': {
2640
- 'contentPlaybackContext': context,
2641
- },
2648
+ 'playbackContext': playback_context,
2642
2649
  **cls._get_checkok_params(),
2643
2650
  }
2644
2651
 
@@ -2866,7 +2873,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
2866
2873
  yt_query['serviceIntegrityDimensions'] = {'poToken': po_token}
2867
2874
 
2868
2875
  sts = self._extract_signature_timestamp(video_id, player_url, webpage_ytcfg, fatal=False) if player_url else None
2869
- yt_query.update(self._generate_player_context(sts))
2876
+
2877
+ use_ad_playback_context = (
2878
+ self._configuration_arg('use_ad_playback_context', ['false'])[0] != 'false'
2879
+ and traverse_obj(INNERTUBE_CLIENTS, (client, 'SUPPORTS_AD_PLAYBACK_CONTEXT', {bool})))
2880
+
2881
+ yt_query.update(self._generate_player_context(sts, use_ad_playback_context))
2882
+
2870
2883
  return self._extract_response(
2871
2884
  item_id=video_id, ep='player', query=yt_query,
2872
2885
  ytcfg=player_ytcfg, headers=headers, fatal=True,
yt_dlp/version.py CHANGED
@@ -1,8 +1,8 @@
1
1
  # Autogenerated by devscripts/update-version.py
2
2
 
3
- __version__ = '2025.12.01.233105'
3
+ __version__ = '2025.12.04.233042'
4
4
 
5
- RELEASE_GIT_HEAD = '017d76edcf05186df2073bdb5b8351a87f596f4c'
5
+ RELEASE_GIT_HEAD = '7ec6b9bc40ee8a21b11cce83a09a07a37014062e'
6
6
 
7
7
  VARIANT = 'pip'
8
8
 
@@ -12,4 +12,4 @@ CHANNEL = 'nightly'
12
12
 
13
13
  ORIGIN = 'yt-dlp/yt-dlp-nightly-builds'
14
14
 
15
- _pkg_version = '2025.12.01.233105dev'
15
+ _pkg_version = '2025.12.04.233042dev'
@@ -2377,6 +2377,11 @@ youtube
2377
2377
  for the given context)
2378
2378
  - jsc_trace: Enable debug logging for JS Challenge fetching. Either
2379
2379
  true or false (default)
2380
+ - use_ad_playback_context: Skip preroll ads to eliminate the mandatory
2381
+ wait period before download. Do NOT use this when passing premium
2382
+ account cookies to yt-dlp, as it will result in a loss of premium
2383
+ formats. Only effective with the web, web_safari, web_music and mweb
2384
+ player clients. Either true or false (default)
2380
2385
 
2381
2386
  youtube-ejs
2382
2387
 
@@ -2820,6 +2820,14 @@ client requires one for the given context)
2820
2820
  .IP \[bu] 2
2821
2821
  \f[V]jsc_trace\f[R]: Enable debug logging for JS Challenge fetching.
2822
2822
  Either \f[V]true\f[R] or \f[V]false\f[R] (default)
2823
+ .IP \[bu] 2
2824
+ \f[V]use_ad_playback_context\f[R]: Skip preroll ads to eliminate the
2825
+ mandatory wait period before download.
2826
+ Do NOT use this when passing premium account cookies to yt-dlp, as it
2827
+ will result in a loss of premium formats.
2828
+ Only effective with the \f[V]web\f[R], \f[V]web_safari\f[R],
2829
+ \f[V]web_music\f[R] and \f[V]mweb\f[R] player clients.
2830
+ Either \f[V]true\f[R] or \f[V]false\f[R] (default)
2823
2831
  .SS youtube-ejs
2824
2832
  .IP \[bu] 2
2825
2833
  \f[V]jitless\f[R]: Run suported Javascript engines in JIT-less mode.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yt-dlp
3
- Version: 2025.12.1.233105.dev0
3
+ Version: 2025.12.4.233042.dev0
4
4
  Summary: A feature-rich command-line audio/video downloader
5
5
  Project-URL: Documentation, https://github.com/yt-dlp/yt-dlp#readme
6
6
  Project-URL: Repository, https://github.com/yt-dlp/yt-dlp
@@ -1940,6 +1940,7 @@ The following extractors use this feature:
1940
1940
  * `pot_trace`: Enable debug logging for PO Token fetching. Either `true` or `false` (default)
1941
1941
  * `fetch_pot`: Policy to use for fetching a PO Token from providers. One of `always` (always try fetch a PO Token regardless if the client requires one for the given context), `never` (never fetch a PO Token), or `auto` (default; only fetch a PO Token if the client requires one for the given context)
1942
1942
  * `jsc_trace`: Enable debug logging for JS Challenge fetching. Either `true` or `false` (default)
1943
+ * `use_ad_playback_context`: Skip preroll ads to eliminate the mandatory wait period before download. Do NOT use this when passing premium account cookies to yt-dlp, as it will result in a loss of premium formats. Only effective with the `web`, `web_safari`, `web_music` and `mweb` player clients. Either `true` or `false` (default)
1943
1944
 
1944
1945
  #### youtube-ejs
1945
1946
  * `jitless`: Run suported Javascript engines in JIT-less mode. Supported runtimes are `deno`, `node` and `bun`. Provides better security at the cost of performance/speed. Do note that `node` and `bun` are still considered unsecure. Either `true` or `false` (default)
@@ -11,7 +11,7 @@ yt_dlp/options.py,sha256=Icc0JRiKOzITWoMujE_ihEmkCS-uCcie42XhIh8LvS4,100388
11
11
  yt_dlp/plugins.py,sha256=EGmR0ydaahNspGrgszTNX4-YjHe93WOOhcw1gf6PZSs,8215
12
12
  yt_dlp/socks.py,sha256=oAuAfWM6jxI8A5hHDLEKq2U2-k9NyMB_z6nrKzNE9fg,8936
13
13
  yt_dlp/update.py,sha256=sY7gNFBQorzs7sEjRrqL5QOsTBNmGGa_FnpTtbxY1vA,25280
14
- yt_dlp/version.py,sha256=JSzd_8lrqfcXKM05eO6acxz8-EEONE31PTh9xim7cfg,360
14
+ yt_dlp/version.py,sha256=h5SMPbyrWurCsxjBA0uxBzhfB5YV5QG-GrvnO4VodO4,360
15
15
  yt_dlp/webvtt.py,sha256=ONkXaaNCZcX8pQhJn3iwIKyaQ34BtVDrMEdG6wRNZwM,11451
16
16
  yt_dlp/__pyinstaller/__init__.py,sha256=-c4Zo8nQGKAm8wc_LDscxMtK7zr_YhZwRnC9CMruUBE,72
17
17
  yt_dlp/__pyinstaller/hook-yt_dlp.py,sha256=5Rd0zV2pDskjY1KtT0wsjxv4hStx67sLCjUexsFvFus,1339
@@ -88,7 +88,7 @@ yt_dlp/extractor/aparat.py,sha256=GKbLlNAaZum69iendsx8O0Tk4iAIIWGagphg7yNci-k,33
88
88
  yt_dlp/extractor/appleconnect.py,sha256=GxHmmMTqJshlUwK6XWDdKjmhzCmTrKwR41ugo3zwIuY,4286
89
89
  yt_dlp/extractor/applepodcasts.py,sha256=SQ7LN6cWtc5yBltAQJNaPf-e0ud3p4pQBG36xNyOSpc,3363
90
90
  yt_dlp/extractor/appletrailers.py,sha256=KgsL8wSKnoHIk0uotFx2WXhMuq8_gyQUdGWkse9Hvlw,10147
91
- yt_dlp/extractor/archiveorg.py,sha256=-fjcgenCDkchEfLEmftSRfuVv6IOxCax8NzRcTmUeTA,56859
91
+ yt_dlp/extractor/archiveorg.py,sha256=6WdpILvCH1vzY-pzwJeCCE1o6zylMPfTWMc7GwEjsRw,58263
92
92
  yt_dlp/extractor/arcpublishing.py,sha256=z9MAcLu6r72fPeVaKKCPN0a70rzI6iSGB4gPJ2HZVeI,8170
93
93
  yt_dlp/extractor/ard.py,sha256=Q0v-Dca1QMgboPVrP0IBJTs7y9bT5QXaJY2q3LJSteU,34242
94
94
  yt_dlp/extractor/arnes.py,sha256=ndBhmlCxtLDBzXE6wKuMry3vtNGkVywmg5scXfqmTuk,3497
@@ -1059,14 +1059,14 @@ yt_dlp/extractor/zingmp3.py,sha256=KHD-f-1vUPy18Xk-_F_H_LfFR9N7-bONFYWeNRvJ1Z4,2
1059
1059
  yt_dlp/extractor/zoom.py,sha256=DW5TmRR4GWWWloSysqYqN-R5jvDkLTMdsOzsyIWcltk,7090
1060
1060
  yt_dlp/extractor/zype.py,sha256=e3_07aMl65x-ziI5Ge_Ph_lCV4q67DnqeRq2PjIKZj4,5507
1061
1061
  yt_dlp/extractor/youtube/__init__.py,sha256=3F72z6WHXlv41giIdmmVY7Fws-bAnkiWz8Eh3A19004,1454
1062
- yt_dlp/extractor/youtube/_base.py,sha256=9Jj849Oi9WVZI5G2HsgSPsIEbjRvVjWET175cWj-o8Y,55289
1062
+ yt_dlp/extractor/youtube/_base.py,sha256=jQy0mec1bolH7f00ZWKfVy8WGmqW-TVo76ivzCcLlWo,55537
1063
1063
  yt_dlp/extractor/youtube/_clip.py,sha256=__EJUrb6iUCIURupsaa-ixn51q4esfok09znrpvdD88,3073
1064
1064
  yt_dlp/extractor/youtube/_mistakes.py,sha256=bLrxlAYqdR0mTuCLoMmJHh15BHuhxfHXeQFTVBRX9Lk,2142
1065
1065
  yt_dlp/extractor/youtube/_notifications.py,sha256=1nhavzW0e2QWFAWHkfbTU4sSXNp4vUbGFygYNSgbxBE,4585
1066
1066
  yt_dlp/extractor/youtube/_redirect.py,sha256=WWWnGEkfSGBXpZFi_bWY4XcHZ8PDeK7UsndDaTYYhQg,9005
1067
1067
  yt_dlp/extractor/youtube/_search.py,sha256=E9raTPGjUD6mm81WBpT4AsaxyiTBHdNssgzeHwVeNOE,6552
1068
1068
  yt_dlp/extractor/youtube/_tab.py,sha256=NcbpPvJ4XiTDDNBtaLtCZQBKyo2HuNcq_V-AalY8zj8,115736
1069
- yt_dlp/extractor/youtube/_video.py,sha256=6XuGJoXMZiP9ni3xKamfL9QkRmsiMCbisFHbCFDP19k,209315
1069
+ yt_dlp/extractor/youtube/_video.py,sha256=wn6218CML_rXttI4-0ZiyyOduPtomCFvMwpULs5QoLM,209768
1070
1070
  yt_dlp/extractor/youtube/jsc/__init__.py,sha256=HaVFP8ikrLaE-ClAh39-S28WCF4S2KTRaSu7QvA28E8,289
1071
1071
  yt_dlp/extractor/youtube/jsc/_director.py,sha256=92pB-KVSs6plmE5R8gpjkZL9aeoWNR0XTnGOBXMy9go,13167
1072
1072
  yt_dlp/extractor/youtube/jsc/_registry.py,sha256=Vg9GkHKHKKPeRfUQ-XSw01mfx_2Xyodh0SJpwjawYCA,102
@@ -1122,13 +1122,13 @@ yt_dlp/utils/progress.py,sha256=t9kVvJ0oWuEqRzo9fdFbIhHUBtO_8mg348QwZ1faqLo,3261
1122
1122
  yt_dlp/utils/traversal.py,sha256=64E3RcZ56iSX50RI_HbKdDNftkETMLBaEPX791_b7yQ,18265
1123
1123
  yt_dlp/utils/jslib/__init__.py,sha256=CbdJiRA7Eh5PnjF2V4lDTcg0J0XjBMaaq0H4pCfq9Tk,87
1124
1124
  yt_dlp/utils/jslib/devalue.py,sha256=7DCGK_zUN0ZeV5hwPT06zaRMUxX_hyUyFWqs79rxw24,5621
1125
- yt_dlp-2025.12.1.233105.dev0.data/data/share/bash-completion/completions/yt-dlp,sha256=b0pb9GLseKD27CjnLE6LlhVxhfmQjmyqV6r_CRbd6ko,5989
1126
- yt_dlp-2025.12.1.233105.dev0.data/data/share/doc/yt_dlp/README.txt,sha256=aO1yTJrp0tKhrdUa5fWmMnVxkrpUi0u3FoYo2uE2rVo,164489
1127
- yt_dlp-2025.12.1.233105.dev0.data/data/share/fish/vendor_completions.d/yt-dlp.fish,sha256=hLa6lZnm7keENpNCjml9A88hbvefdsdoOpAiaNCVyHo,51488
1128
- yt_dlp-2025.12.1.233105.dev0.data/data/share/man/man1/yt-dlp.1,sha256=YyGTf0wqbKUSsZigQ_6pOsAvxMyXNv_pd-6KmDBOrIY,158932
1129
- yt_dlp-2025.12.1.233105.dev0.data/data/share/zsh/site-functions/_yt-dlp,sha256=pNhu8tT4ZKrksLRI2mXLqarzGGhnOlm_hkCBVhSxLzg,5985
1130
- yt_dlp-2025.12.1.233105.dev0.dist-info/METADATA,sha256=nXmoKce4sHvNV2IiWcD9rj0P91uFyh-mvoNiKXBOEug,179882
1131
- yt_dlp-2025.12.1.233105.dev0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
1132
- yt_dlp-2025.12.1.233105.dev0.dist-info/entry_points.txt,sha256=vWfetvzYgZIwDfMW6BjCe0Cy4pmTZEXRNzxAkfYlRJA,103
1133
- yt_dlp-2025.12.1.233105.dev0.dist-info/licenses/LICENSE,sha256=fhLl30uuEsshWBuhV87SDhmGoFCN0Q0Oikq5pM-U6Fw,1211
1134
- yt_dlp-2025.12.1.233105.dev0.dist-info/RECORD,,
1125
+ yt_dlp-2025.12.4.233042.dev0.data/data/share/bash-completion/completions/yt-dlp,sha256=b0pb9GLseKD27CjnLE6LlhVxhfmQjmyqV6r_CRbd6ko,5989
1126
+ yt_dlp-2025.12.4.233042.dev0.data/data/share/doc/yt_dlp/README.txt,sha256=Bgx271dvWVM7TqhGKdrgqQGXSJmlvO678jfyNC6aCJA,164826
1127
+ yt_dlp-2025.12.4.233042.dev0.data/data/share/fish/vendor_completions.d/yt-dlp.fish,sha256=hLa6lZnm7keENpNCjml9A88hbvefdsdoOpAiaNCVyHo,51488
1128
+ yt_dlp-2025.12.4.233042.dev0.data/data/share/man/man1/yt-dlp.1,sha256=EfXpaxlohoxUn8X5ROJ0THnppGch3vy9bXOPsKPs3Bw,159331
1129
+ yt_dlp-2025.12.4.233042.dev0.data/data/share/zsh/site-functions/_yt-dlp,sha256=pNhu8tT4ZKrksLRI2mXLqarzGGhnOlm_hkCBVhSxLzg,5985
1130
+ yt_dlp-2025.12.4.233042.dev0.dist-info/METADATA,sha256=KrHbZGBKrm9rtvEdPyUCnAM_gDUGGmVdDr8EJ862XhQ,180215
1131
+ yt_dlp-2025.12.4.233042.dev0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
1132
+ yt_dlp-2025.12.4.233042.dev0.dist-info/entry_points.txt,sha256=vWfetvzYgZIwDfMW6BjCe0Cy4pmTZEXRNzxAkfYlRJA,103
1133
+ yt_dlp-2025.12.4.233042.dev0.dist-info/licenses/LICENSE,sha256=fhLl30uuEsshWBuhV87SDhmGoFCN0Q0Oikq5pM-U6Fw,1211
1134
+ yt_dlp-2025.12.4.233042.dev0.dist-info/RECORD,,