diff options
author | exwm <thighsman@protonmail.com> | 2020-11-02 12:19:16 -0500 |
---|---|---|
committer | exwm <thighsman@protonmail.com> | 2020-11-02 18:35:45 -0500 |
commit | 73cc1b9125b5f2f80d777f746c16b5e73b92ddd5 (patch) | |
tree | c5d170653de84487dfdd75a304f251dacf0edb16 | |
parent | 341736255610aea3920d9e8bf627705fdb6756b1 (diff) | |
download | hypervideo-pre-73cc1b9125b5f2f80d777f746c16b5e73b92ddd5.tar.lz hypervideo-pre-73cc1b9125b5f2f80d777f746c16b5e73b92ddd5.tar.xz hypervideo-pre-73cc1b9125b5f2f80d777f746c16b5e73b92ddd5.zip |
[vlive] fix: live video extractor
* use live video info endpoint from v3 api
-rw-r--r-- | youtube_dlc/extractor/vlive.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/youtube_dlc/extractor/vlive.py b/youtube_dlc/extractor/vlive.py index 5c8988c92..874f5203e 100644 --- a/youtube_dlc/extractor/vlive.py +++ b/youtube_dlc/extractor/vlive.py @@ -162,19 +162,16 @@ class VLiveIE(NaverBaseIE): } def _live(self, video_id, webpage, params): - init_page = self._download_init_page(video_id) + LIVE_INFO_ENDPOINT = 'https://www.vlive.tv/globalv-web/vam-web/old/v3/live/%s/playInfo' % video_id + play_info = self._download_json(LIVE_INFO_ENDPOINT, video_id, + headers={"referer": "https://www.vlive.tv"}) - live_params = self._search_regex( - r'"liveStreamInfo"\s*:\s*(".*"),', - init_page, 'live stream info') - live_params = self._parse_json(live_params, video_id) - live_params = self._parse_json(live_params, video_id) + streams = try_get(play_info, lambda x: x["result"]["streamList"]) or [] formats = [] - for vid in live_params.get('resolutions', []): + for stream in streams: formats.extend(self._extract_m3u8_formats( - vid['cdnUrl'], video_id, 'mp4', - m3u8_id=vid.get('name'), + stream['serviceUrl'], video_id, 'mp4', fatal=False, live=True)) self._sort_formats(formats) |