aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/extractor
diff options
context:
space:
mode:
authorexwm <thighsman@protonmail.com>2020-11-01 21:26:17 -0500
committerexwm <thighsman@protonmail.com>2020-11-02 18:35:45 -0500
commit341736255610aea3920d9e8bf627705fdb6756b1 (patch)
tree4235fd7fcd6df91c1f81522e9d7213d9ba9f5d02 /youtube_dlc/extractor
parent8ba3ad0a48bcc2e12f2ed82c0c5e0999e5e94281 (diff)
downloadhypervideo-pre-341736255610aea3920d9e8bf627705fdb6756b1.tar.lz
hypervideo-pre-341736255610aea3920d9e8bf627705fdb6756b1.tar.xz
hypervideo-pre-341736255610aea3920d9e8bf627705fdb6756b1.zip
[vlive] fix: vod logic wrongly used for live video
Diffstat (limited to 'youtube_dlc/extractor')
-rw-r--r--youtube_dlc/extractor/vlive.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/youtube_dlc/extractor/vlive.py b/youtube_dlc/extractor/vlive.py
index 70d5d8dfb..5c8988c92 100644
--- a/youtube_dlc/extractor/vlive.py
+++ b/youtube_dlc/extractor/vlive.py
@@ -127,18 +127,12 @@ class VLiveIE(NaverBaseIE):
raise ExtractorError('Failed to extract video parameters.')
video_id = working_id if 'video' in url else str(video_params["videoSeq"])
- long_video_id = video_params["vodId"]
- video_type = video_params["type"]
-
- VOD_KEY_ENDPOINT = 'https://www.vlive.tv/globalv-web/vam-web/video/v1.0/vod/%s/inkey' % video_id
- key_json = self._download_json(VOD_KEY_ENDPOINT, video_id,
- headers={"referer": "https://www.vlive.tv"})
- key = key_json["inkey"]
+ video_type = video_params["type"]
if video_type in ('VOD'):
encoding_status = video_params["encodingStatus"]
if encoding_status == 'COMPLETE':
- return self._replay(video_id, webpage, long_video_id, key, params)
+ return self._replay(video_id, webpage, params, video_params)
else:
raise ExtractorError('VOD encoding not yet complete. Please try again later.',
expected=True)
@@ -193,7 +187,13 @@ class VLiveIE(NaverBaseIE):
})
return info
- def _replay(self, video_id, webpage, long_video_id, key, params):
+ def _replay(self, video_id, webpage, params, video_params):
+ VOD_KEY_ENDPOINT = 'https://www.vlive.tv/globalv-web/vam-web/video/v1.0/vod/%s/inkey' % video_id
+ key_json = self._download_json(VOD_KEY_ENDPOINT, video_id,
+ headers={"referer": "https://www.vlive.tv"})
+ key = key_json["inkey"]
+ long_video_id = video_params["vodId"]
+
if '' in (long_video_id, key):
init_page = self._download_init_page(video_id)
video_info = self._parse_json(self._search_regex(