From ea7d7d85d3e54f805226b5c7735fecc24aa8539f Mon Sep 17 00:00:00 2001 From: grqx_wsl <173253225+grqx@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:15:54 +1300 Subject: [PATCH] request with `impersonate=True` --- yt_dlp/extractor/bahamut.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/bahamut.py b/yt_dlp/extractor/bahamut.py index 22a2510c57..3c7f344c9d 100644 --- a/yt_dlp/extractor/bahamut.py +++ b/yt_dlp/extractor/bahamut.py @@ -31,14 +31,14 @@ def _real_extract(self, url): or self._download_json( 'https://ani.gamer.com.tw/ajax/getdeviceid.php', video_id, 'Downloading device ID', 'Failed to download device ID', - headers=self.geo_verification_headers())['deviceid']) + impersonate=True, headers=self.geo_verification_headers())['deviceid']) # TODO: extract metadata from webpage metadata = {} if api_result := self._download_json( 'https://api.gamer.com.tw/anime/v1/video.php', video_id, 'Downloading video info', 'Failed to download video info', - query={'videoSn': video_id}).get('data'): + impersonate=True, query={'videoSn': video_id}).get('data'): metadata.update(traverse_obj(api_result, ('anime', { 'description': 'content', @@ -77,7 +77,7 @@ def _real_extract(self, url): note='Downloading m3u8 URL', errnote='Failed to download m3u8 URL', query={ 'sn': video_id, 'device': device_id, - }, headers=self.geo_verification_headers(), expected_status=400) + }, impersonate=True, headers=self.geo_verification_headers(), expected_status=400) formats_fatal = True if urlh.status == 400: