From d7aaaaf00397634eeaf7dec7b91d57d1b64bd30a Mon Sep 17 00:00:00 2001 From: garret1317 Date: Thu, 6 Mar 2025 07:31:41 +0000 Subject: filter out "cul_area_id" in search params - HTTP Error 415 site used to use "cul_area_id" in the search url, now it uses "cur_area_id" (with an r) and it outright rejects the old one with HTTP Error 415: Unsupported Media Type probably better to patch in the extractor than to break peoples scripts etc - site does this too idk why they felt the need to break the old one --- yt_dlp_plugins/extractor/radiko.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index 3839aa9..9ca353b 100644 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -609,6 +609,11 @@ class RadikoSearchIE(InfoExtractor): # urllib.parse interprets the path as just one giant fragment because of the #, so we hack it away queries = parse_qs(url) + if queries.get("cul_area_id"): + queries["cur_area_id"] = queries.pop("cul_area_id") + # site used to use "cul_area_id" in the search url, now it uses "cur_area_id" (with an r) + # and outright rejects the old one with HTTP Error 415: Unsupported Media Type + search_url = update_url_query("https://radiko.jp/v3/api/program/search", { **queries, "uid": "".join(random.choices("0123456789abcdef", k=32)), -- cgit v1.2.3-70-g09d2