From 02a17992b87795e828d1067a099d35d374ca6641 Mon Sep 17 00:00:00 2001 From: Tony Lefebvre Date: Sun, 28 Apr 2019 21:37:46 +0200 Subject: [PATCH] [20875] fix Can't be None --- youtube_dl/extractor/livestream.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/youtube_dl/extractor/livestream.py b/youtube_dl/extractor/livestream.py index 71cddc46a..c53c79361 100644 --- a/youtube_dl/extractor/livestream.py +++ b/youtube_dl/extractor/livestream.py @@ -222,20 +222,19 @@ class LivestreamIE(InfoExtractor): api_url = self._API_URL_TEMPLATE % (account, event) api_new_url = self._API_NEW_URL_TEMPLATE % (account, event) - if self._downloader is not None: - downloader_params = self._downloader.params - video_password = downloader_params.get("videopassword") - if video_password: - # use the given video password to unlock livestream.com event - self.to_screen("Using video password") - password_request_url = api_new_url + "/password_tokens" - r = requests.post(password_request_url, { - "password": video_password - }) - r.raise_for_status() - password_token = r.json()["password_token"] - event_key = event + ":pt:" + password_token - api_url = self._API_URL_TEMPLATE % (account, event_key) + downloader_params = self._downloader.params + video_password = downloader_params.get("videopassword") + if video_password: + # use the given video password to unlock livestream.com event + self.to_screen("Using video password") + password_request_url = api_new_url + "/password_tokens" + r = requests.post(password_request_url, { + "password": video_password + }) + r.raise_for_status() + password_token = r.json()["password_token"] + event_key = event + ":pt:" + password_token + api_url = self._API_URL_TEMPLATE % (account, event_key) if video_id: video_data = self._download_json(