mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-09 14:58:32 +00:00
fix
This commit is contained in:
parent
dfe1dc52c2
commit
7f932fd180
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class NiconicoBaseIE(InfoExtractor):
|
class NiconicoBaseIE(InfoExtractor):
|
||||||
|
_API_BASE = 'https://nvapi.nicovideo.jp'
|
||||||
_BASE_URL = 'https://www.nicovideo.jp'
|
_BASE_URL = 'https://www.nicovideo.jp'
|
||||||
_GEO_BYPASS = False
|
_GEO_BYPASS = False
|
||||||
_GEO_COUNTRIES = ['JP']
|
_GEO_COUNTRIES = ['JP']
|
||||||
@ -334,12 +335,12 @@ def _extract_formats(self, api_data, video_id):
|
|||||||
return
|
return
|
||||||
|
|
||||||
m3u8_url = self._download_json(
|
m3u8_url = self._download_json(
|
||||||
f'https://nvapi.nicovideo.jp/v1/watch/{video_id}/access-rights/hls',
|
f'{self._API_BASE}/v1/watch/{video_id}/access-rights/hls',
|
||||||
video_id, headers={
|
video_id, headers={
|
||||||
'Accept': 'application/json;charset=utf-8',
|
'Accept': 'application/json;charset=utf-8',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-Access-Right-Key': access_key,
|
'X-Access-Right-Key': access_key,
|
||||||
'X-Request-With': 'https://www.nicovideo.jp',
|
'X-Request-With': self._BASE_URL,
|
||||||
**self._HEADERS,
|
**self._HEADERS,
|
||||||
}, query={
|
}, query={
|
||||||
'actionTrackId': track_id,
|
'actionTrackId': track_id,
|
||||||
@ -358,7 +359,7 @@ def _extract_formats(self, api_data, video_id):
|
|||||||
'asr': ('samplingRate', {int_or_none}),
|
'asr': ('samplingRate', {int_or_none}),
|
||||||
'format_id': ('id', {str}),
|
'format_id': ('id', {str}),
|
||||||
'quality': ('qualityLevel', {int_or_none}),
|
'quality': ('qualityLevel', {int_or_none}),
|
||||||
}), get_all=False),
|
}, any)),
|
||||||
'acodec': 'aac',
|
'acodec': 'aac',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user