0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-04 23:35:04 +00:00

[extractor/youtube] Fix 5038f6d713

* [fragment] Fix `request_data`
* [youtube] Don't use POST for now. It may be easier to break in future

Authored by: bashonly, coletdjnz
This commit is contained in:
pukkandan 2023-02-28 23:34:43 +05:30
parent 65f6e80780
commit f34804b2f9
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
3 changed files with 3 additions and 2 deletions

View file

@ -466,7 +466,8 @@ def error_callback(err, count, retries):
for retry in RetryManager(self.params.get('fragment_retries'), error_callback): for retry in RetryManager(self.params.get('fragment_retries'), error_callback):
try: try:
ctx['fragment_count'] = fragment.get('fragment_count') 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 return
except (urllib.error.HTTPError, http.client.IncompleteRead) as err: except (urllib.error.HTTPError, http.client.IncompleteRead) as err:
retry.error = err retry.error = err

View file

@ -132,6 +132,7 @@ class InfoExtractor:
is parsed from a string (in case of is parsed from a string (in case of
fragmented media) fragmented media)
for MSS - URL of the ISM manifest. for MSS - URL of the ISM manifest.
* request_data Data to send in POST request to the URL
* manifest_url * manifest_url
The URL of the manifest file in case of The URL of the manifest file in case of
fragmented media: fragmented media:

View file

@ -3778,7 +3778,6 @@ def _extract_formats_and_subtitles(self, streaming_data, video_id, player_url, l
if no_audio or no_video: if no_audio or no_video:
CHUNK_SIZE = 10 << 20 CHUNK_SIZE = 10 << 20
dct.update({ dct.update({
'request_data': b'x',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'fragments': [{ 'fragments': [{
'url': update_url_query(dct['url'], { 'url': update_url_query(dct['url'], {