diff options
author | garret <garret@airmail.cc> | 2023-06-19 05:37:54 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2023-06-19 05:37:54 +0100 |
commit | 3c535cbc5f47890378cca5942e4580e4c41c10c3 (patch) | |
tree | 35a3eafb7c2ad132ef051fa61f9466890e58c735 /yt_dlp_plugins/extractor | |
parent | 9cebdaf880777daed796b609aa9436fecd3c359e (diff) | |
download | yt-dlp-rajiko-3c535cbc5f47890378cca5942e4580e4c41c10c3.tar.gz yt-dlp-rajiko-3c535cbc5f47890378cca5942e4580e4c41c10c3.tar.bz2 yt-dlp-rajiko-3c535cbc5f47890378cca5942e4580e4c41c10c3.zip |
loop through search results the old-fashioned way
not smort enough for traverse_obj
Diffstat (limited to 'yt_dlp_plugins/extractor')
-rwxr-xr-x | yt_dlp_plugins/extractor/radiko.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index fd9320d..9aac5f7 100755 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -849,11 +849,7 @@ class RadikoSearchIE(_RadikoBaseIE): "app_id": "pc", }) data = self._download_json(search_url, None) - - results = traverse_obj(data, ("data", ..., { - "station": "station_id", - "time": ("start_time", {self._strip_date}) - })) + results = [(i.get("station_id"), self._strip_date(i.get("start_time"))) for i in data.get("data")] key = traverse_obj(queries, ("key", 0)) day = traverse_obj(queries, ('start_day', 0)) or "all" @@ -867,8 +863,7 @@ class RadikoSearchIE(_RadikoBaseIE): "title": traverse_obj(queries, ("key", 0)), "id": playlist_id, "entries": [self.url_result(f"https://radiko.jp/#!/ts/{station}/{time}", RadikoTimeFreeIE) - for station, time in [ep.values() for ep in results]] - # TODO: have traverse_obj return a tuple, not a dict + for station, time in results] } class RadikoShareIE(_RadikoBaseIE): |