diff options
author | garret <garret@airmail.cc> | 2023-05-08 23:22:45 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2023-05-08 23:25:15 +0100 |
commit | 2a3e3a8cdef86578623fdd257da2ca3ce522226f (patch) | |
tree | 483e9661efedac1816a02212d79df3b56b1e359e /yt_dlp_plugins | |
parent | 33fe77a62487b5514974a9a1518b1ec1e4c22044 (diff) | |
download | yt-dlp-rajiko-2a3e3a8cdef86578623fdd257da2ca3ce522226f.tar.gz yt-dlp-rajiko-2a3e3a8cdef86578623fdd257da2ca3ce522226f.tar.bz2 yt-dlp-rajiko-2a3e3a8cdef86578623fdd257da2ca3ce522226f.zip |
re-index regions if station not present
stations change names, new ones get added, etc
assume it's something like this and try to correct for it before kicking you out with an error
Diffstat (limited to 'yt_dlp_plugins')
-rwxr-xr-x | yt_dlp_plugins/extractor/radiko.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index 7ac4aee..31d12a5 100755 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -428,7 +428,10 @@ class _RadikoBaseIE(InfoExtractor): return info def _get_station_region(self, station): - regions = self.cache.load('rajiko', 'region_index') or self._index_regions() + regions = self.cache.load('rajiko', 'region_index') + if regions is None or station not in regions: + regions = self._index_regions() + return regions[station] def _negotiate_token(self, station_region): |