request with `impersonate=True`

This commit is contained in:
grqx_wsl 2024-11-01 11:15:54 +13:00
parent 8e010ace41
commit ea7d7d85d3
1 changed files with 3 additions and 3 deletions

View File

@ -31,14 +31,14 @@ class BahamutIE(InfoExtractor):
or self._download_json( or self._download_json(
'https://ani.gamer.com.tw/ajax/getdeviceid.php', video_id, 'https://ani.gamer.com.tw/ajax/getdeviceid.php', video_id,
'Downloading device ID', 'Failed to download device 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 # TODO: extract metadata from webpage
metadata = {} metadata = {}
if api_result := self._download_json( if api_result := self._download_json(
'https://api.gamer.com.tw/anime/v1/video.php', video_id, 'https://api.gamer.com.tw/anime/v1/video.php', video_id,
'Downloading video info', 'Failed to download video info', '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', { metadata.update(traverse_obj(api_result, ('anime', {
'description': 'content', 'description': 'content',
@ -77,7 +77,7 @@ class BahamutIE(InfoExtractor):
note='Downloading m3u8 URL', errnote='Failed to download m3u8 URL', query={ note='Downloading m3u8 URL', errnote='Failed to download m3u8 URL', query={
'sn': video_id, 'sn': video_id,
'device': device_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 formats_fatal = True
if urlh.status == 400: if urlh.status == 400: