mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-15 03:41:33 +01:00
add http_headers for downloading
This commit is contained in:
parent
106f6c931b
commit
2ad1cbf12d
1 changed files with 5 additions and 2 deletions
|
@ -86,13 +86,16 @@ class AniGamerIE(InfoExtractor):
|
||||||
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, subs = self._extract_m3u8_formats_and_subtitles(src, video_id, 'mp4', headers={
|
formats = self._extract_m3u8_formats(src, video_id, 'mp4', headers={
|
||||||
'Origin': 'https://ani.gamer.com.tw',
|
'Origin': 'https://ani.gamer.com.tw',
|
||||||
**self.geo_verification_headers(),
|
**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': formats,
|
||||||
'subtitles': subs,
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue