From f8e15176cbb507ffd47e17b83877cfbdb2357c4c Mon Sep 17 00:00:00 2001 From: grqx_wsl <173253225+grqx@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:19:58 +1300 Subject: [PATCH] add http headers at the root of the info_dict simplify structure --- yt_dlp/extractor/anigamer.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/yt_dlp/extractor/anigamer.py b/yt_dlp/extractor/anigamer.py index 71e74983c..b981d24ea 100644 --- a/yt_dlp/extractor/anigamer.py +++ b/yt_dlp/extractor/anigamer.py @@ -86,16 +86,14 @@ class AniGamerIE(InfoExtractor): raise ExtractorError('Invalid device id!') # TODO: handle more error codes 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 { **metadata, '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', + }, }