From 601facf0d77fa82dfa34a5bfc6898b5fe1500336 Mon Sep 17 00:00:00 2001 From: garret Date: Thu, 28 Sep 2023 01:51:36 +0100 Subject: Make token cache check less dumb --- yt_dlp_plugins/extractor/radiko.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'yt_dlp_plugins/extractor/radiko.py') 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) -- cgit v1.2.3-70-g09d2