mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-14 08:28:29 +00:00
Set http_headers
This commit is contained in:
parent
f0b7ec707a
commit
f1be5d6967
@ -128,9 +128,6 @@ def _real_extract(self, url):
|
|||||||
formats.extend(fmts)
|
formats.extend(fmts)
|
||||||
self._merge_subtitles(subs, target=subtitles)
|
self._merge_subtitles(subs, target=subtitles)
|
||||||
|
|
||||||
for f in formats:
|
|
||||||
f['http_headers'] = headers
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': f'{urllib.parse.urlparse(api_base).hostname}_{video_id}',
|
'id': f'{urllib.parse.urlparse(api_base).hostname}_{video_id}',
|
||||||
**traverse_obj(traverse_obj(video_info, ('blocks', 0)), {
|
**traverse_obj(traverse_obj(video_info, ('blocks', 0)), {
|
||||||
@ -147,6 +144,7 @@ def _real_extract(self, url):
|
|||||||
}),
|
}),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
|
'http_headers': headers,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -228,9 +226,6 @@ def _real_extract(self, url):
|
|||||||
formats.extend(fmts)
|
formats.extend(fmts)
|
||||||
self._merge_subtitles(subs, target=subtitles)
|
self._merge_subtitles(subs, target=subtitles)
|
||||||
|
|
||||||
for f in formats:
|
|
||||||
f['http_headers'] = headers
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': f'{urllib.parse.urlparse(api_base).hostname}_{video_id}',
|
'id': f'{urllib.parse.urlparse(api_base).hostname}_{video_id}',
|
||||||
**traverse_obj(channel, {
|
**traverse_obj(channel, {
|
||||||
@ -239,5 +234,6 @@ def _real_extract(self, url):
|
|||||||
}),
|
}),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
|
'http_headers': headers,
|
||||||
'is_live': True,
|
'is_live': True,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user