aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/yt_dlp_plugins/extractor/radiko.py
diff options
context:
space:
mode:
authorgarret1317 <garret@airmail.cc>2025-09-19 11:18:02 +0100
committergarret1317 <garret@airmail.cc>2025-09-19 11:34:52 +0100
commite98426f316bf9d60d6e131a9163c8b872d663a92 (patch)
tree5b57c8b94d9e0e7438091c1832549db26e1d2f1b /yt_dlp_plugins/extractor/radiko.py
parentb8807109ba7e4515ffc5d6d3d0fcf8888acd13a3 (diff)
downloadyt-dlp-rajiko-e98426f316bf9d60d6e131a9163c8b872d663a92.tar.gz
yt-dlp-rajiko-e98426f316bf9d60d6e131a9163c8b872d663a92.tar.bz2
yt-dlp-rajiko-e98426f316bf9d60d6e131a9163c8b872d663a92.zip
oh, absence of a filter means every option doesnt it
Diffstat (limited to 'yt_dlp_plugins/extractor/radiko.py')
-rw-r--r--yt_dlp_plugins/extractor/radiko.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py
index 6654b57..ec260ab 100644
--- a/yt_dlp_plugins/extractor/radiko.py
+++ b/yt_dlp_plugins/extractor/radiko.py
@@ -627,29 +627,30 @@ class RadikoSearchIE(InfoExtractor):
if queries.get("cul_area_id"):
queries["cur_area_id"] = queries.pop("cul_area_id")
- filter_str = ""
if queries.get("filter"):
filter_set = set(queries["filter"][0].split("|"))
del queries["filter"]
+ else:
+ filter_set = {"future", "past", "channel"}
- if filter_set == {"channel"}:
- podcast_search_url = update_url_query(
- "https://radiko.jp/!/search/podcast/live", {"key": key}
- ).replace("!", "#!", 1) # same shit with urllib.parse
- return self.url_result(podcast_search_url, ie=RadikoPodcastSearchIE)
+ if filter_set == {"channel"}:
+ podcast_search_url = update_url_query(
+ "https://radiko.jp/!/search/podcast/live", {"key": key}
+ ).replace("!", "#!", 1) # same shit with urllib.parse
+ return self.url_result(podcast_search_url, ie=RadikoPodcastSearchIE)
- if "channel" in filter_set:
- self.report_warning("Skipping podcasts. If you really want EVERY EPISODE of EVERY RESULT, set your search filter to Podcasts only.")
+ if "channel" in filter_set:
+ self.report_warning("Skipping podcasts. If you really want EVERY EPISODE of EVERY RESULT, set your search filter to Podcasts only.")
+ filter_set.discard("channel")
- filter_set.discard("channel")
- if filter_set == {"future", "past"}:
- filter_str = ""
- else:
- filter_str = "|".join(filter_set) # there should be only one filter now, so this should be the same as filter_set[0]
- # but if there's more than one, then we should at least try to pass it through as-is, in the hope that it works
- if len(filter_set) != 1:
- # but also kick up a stink about it so it's clear it probably won't
- self.report_warning("Your search has an unknkown combination of filters, so this request will probably fail!")
+ if filter_set == {"future", "past"}:
+ filter_str = ""
+ else:
+ filter_str = "|".join(filter_set) # there should be only one filter now, so this should be the same as filter_set[0]
+ # but if there's more than one, then we should at least try to pass it through as-is, in the hope that it works
+ if len(filter_set) != 1:
+ # but also kick up a stink about it so it's clear it probably won't
+ self.report_warning("Your search has an unknkown combination of filters, so this request will probably fail!")
search_url = update_url_query("https://api.annex-cf.radiko.jp/v1/programs/legacy/perl/program/search", {
**queries,