diff options
author | exwm <thighsman@protonmail.com> | 2020-11-03 21:05:19 -0500 |
---|---|---|
committer | exwm <thighsman@protonmail.com> | 2020-11-03 21:05:19 -0500 |
commit | c434e9f504ed93ae851ff6b6b46051c91b0ec213 (patch) | |
tree | 03ef05958b450e641cba7e2fbe3a982cb74327dc | |
parent | be5d6c213cc68ab0ae3764db7c3fd9ed128b3ff3 (diff) | |
download | hypervideo-pre-c434e9f504ed93ae851ff6b6b46051c91b0ec213.tar.lz hypervideo-pre-c434e9f504ed93ae851ff6b6b46051c91b0ec213.tar.xz hypervideo-pre-c434e9f504ed93ae851ff6b6b46051c91b0ec213.zip |
[vlive] fix: missing expected types for try_get
-rw-r--r-- | youtube_dlc/extractor/vlive.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dlc/extractor/vlive.py b/youtube_dlc/extractor/vlive.py index a205af921..fe9788d8f 100644 --- a/youtube_dlc/extractor/vlive.py +++ b/youtube_dlc/extractor/vlive.py @@ -119,13 +119,14 @@ class VLiveIE(NaverBaseIE): PARAMS_RE, webpage, PARAMS_FIELD, default='', flags=re.DOTALL) params = self._parse_json(params, working_id, fatal=False) - video_params = try_get(params, lambda x: x["postDetail"]["post"]["officialVideo"]) + video_params = try_get(params, lambda x: x["postDetail"]["post"]["officialVideo"], dict) if video_params is None: - error_data = try_get(params, lambda x: x["postDetail"]["error"]["data"]) + error_data = try_get(params, lambda x: x["postDetail"]["error"]["data"], dict) product_type = try_get(error_data, [lambda x: x["officialVideo"]["productType"], - lambda x: x["board"]["boardType"]]) + lambda x: x["board"]["boardType"]], + compat_str) if product_type in ('VLIVE_PLUS', 'VLIVE+'): self.raise_login_required('This video is only available for VLIVE+ subscribers') elif 'post' in url: @@ -173,7 +174,7 @@ class VLiveIE(NaverBaseIE): play_info = self._download_json(LIVE_INFO_ENDPOINT, video_id, headers={"referer": "https://www.vlive.tv"}) - streams = try_get(play_info, lambda x: x["result"]["streamList"]) or [] + streams = try_get(play_info, lambda x: x["result"]["streamList"], list) or [] formats = [] for stream in streams: |