From 2ad1cbf12d0916b6ba1cff99e3e16cf851d8a09a Mon Sep 17 00:00:00 2001 From: grqx_wsl <173253225+grqx@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:14:30 +1300 Subject: [PATCH] add http_headers for downloading --- yt_dlp/extractor/anigamer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/anigamer.py b/yt_dlp/extractor/anigamer.py index 15f647d3a..71e74983c 100644 --- a/yt_dlp/extractor/anigamer.py +++ b/yt_dlp/extractor/anigamer.py @@ -86,13 +86,16 @@ class AniGamerIE(InfoExtractor): raise ExtractorError('Invalid device id!') # TODO: handle more error codes 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', **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 { **metadata, 'id': video_id, 'formats': formats, - 'subtitles': subs, }