diff options
author | garret <garret@airmail.cc> | 2023-09-28 01:51:36 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2023-09-28 01:51:36 +0100 |
commit | 601facf0d77fa82dfa34a5bfc6898b5fe1500336 (patch) | |
tree | 5134649807825788c1b9afda7bcdf9a43215f4c3 | |
parent | 28701271aeb9d6796e89abb8d5d4ac054fb2dcf0 (diff) | |
download | yt-dlp-rajiko-601facf0d77fa82dfa34a5bfc6898b5fe1500336.tar.gz yt-dlp-rajiko-601facf0d77fa82dfa34a5bfc6898b5fe1500336.tar.bz2 yt-dlp-rajiko-601facf0d77fa82dfa34a5bfc6898b5fe1500336.zip |
Make token cache check less dumb
-rwxr-xr-x | yt_dlp_plugins/extractor/radiko.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index dd0c380..656fefc 100755 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -495,11 +495,9 @@ class _RadikoBaseIE(InfoExtractor): response = self._download_webpage("https://radiko.jp/v2/api/auth_check", station_region, "Checking cached token", headers=token, expected_status=401) self.write_debug(response) - if response != "OK": - token = self._negotiate_token(station_region) - else: - token = self._negotiate_token(station_region) - return token + if response == "OK": + return token + return self._negotiate_token(station_region) def _get_station_meta(self, region, station_id): cachedata = self.cache.load("rajiko", station_id) |