]> jfr.im git - yt-dlp.git/commitdiff
[extractor/youtube] Fix 5038f6d713303e0967d002216e7a88652401c22a
authorpukkandan <redacted>
Tue, 28 Feb 2023 18:04:43 +0000 (23:34 +0530)
committerpukkandan <redacted>
Tue, 28 Feb 2023 18:04:43 +0000 (23:34 +0530)
* [fragment] Fix `request_data`
* [youtube] Don't use POST for now. It may be easier to break in future

Authored by: bashonly, coletdjnz

yt_dlp/downloader/fragment.py
yt_dlp/extractor/common.py
yt_dlp/extractor/youtube.py

index 039cb14927917aca25eef7cb5c7bfc7b66e5a304..377f138b7636d7515f0b8bccd2ec688c87830043 100644 (file)
@@ -466,7 +466,8 @@ def error_callback(err, count, retries):
             for retry in RetryManager(self.params.get('fragment_retries'), error_callback):
                 try:
                     ctx['fragment_count'] = fragment.get('fragment_count')
-                    if not self._download_fragment(ctx, fragment['url'], info_dict, headers):
+                    if not self._download_fragment(
+                            ctx, fragment['url'], info_dict, headers, info_dict.get('request_data')):
                         return
                 except (urllib.error.HTTPError, http.client.IncompleteRead) as err:
                     retry.error = err
index 86bef173f5b002af87892e13a432f3636f7f9d92..98efe0e9da27d910af82ea86f51b1ec27d42c615 100644 (file)
@@ -132,6 +132,7 @@ class InfoExtractor:
                                        is parsed from a string (in case of
                                        fragmented media)
                                    for MSS - URL of the ISM manifest.
+                    * request_data  Data to send in POST request to the URL
                     * manifest_url
                                  The URL of the manifest file in case of
                                  fragmented media:
index 0227a1f83c51f5f14e267028dfcb915858a38b77..f5ffce7750659b1f8055d405ff8e81dd661e3b1a 100644 (file)
@@ -3778,7 +3778,6 @@ def _extract_formats_and_subtitles(self, streaming_data, video_id, player_url, l
             if no_audio or no_video:
                 CHUNK_SIZE = 10 << 20
                 dct.update({
-                    'request_data': b'x',
                     'protocol': 'http_dash_segments',
                     'fragments': [{
                         'url': update_url_query(dct['url'], {