mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
add http headers at the root of the info_dict
simplify structure
This commit is contained in:
parent
2ad1cbf12d
commit
f8e15176cb
1 changed files with 7 additions and 9 deletions
|
@ -86,16 +86,14 @@ def _real_extract(self, url):
|
||||||
raise ExtractorError('Invalid device id!')
|
raise ExtractorError('Invalid device id!')
|
||||||
# TODO: handle more error codes
|
# TODO: handle more error codes
|
||||||
src = m3u8_info['src']
|
src = m3u8_info['src']
|
||||||
formats = self._extract_m3u8_formats(src, video_id, 'mp4', headers={
|
|
||||||
'Origin': 'https://ani.gamer.com.tw',
|
|
||||||
**self.geo_verification_headers(),
|
|
||||||
})
|
|
||||||
for fmt in formats:
|
|
||||||
http_headers = fmt.get('http_headers')
|
|
||||||
http_headers['Origin'] = 'https://ani.gamer.com.tw'
|
|
||||||
fmt['http_headers'] = http_headers
|
|
||||||
return {
|
return {
|
||||||
**metadata,
|
**metadata,
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': formats,
|
'formats': self._extract_m3u8_formats(src, video_id, 'mp4', headers={
|
||||||
|
'Origin': 'https://ani.gamer.com.tw',
|
||||||
|
**self.geo_verification_headers(),
|
||||||
|
}),
|
||||||
|
'http_headers': {
|
||||||
|
'Origin': 'https://ani.gamer.com.tw',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue