diff options
author | garret1317 <garret@airmail.cc> | 2025-06-22 01:25:24 +0100 |
---|---|---|
committer | garret1317 <garret@airmail.cc> | 2025-06-22 01:25:24 +0100 |
commit | 781ce8e7a74aa19df8793a3f29176d82c44f6b6b (patch) | |
tree | 42eb9e1ef68a714d7269a3865c4c7a55f1265644 | |
parent | 12aced7d2d34d3e2ba1b2929aa421adcaabef434 (diff) | |
download | yt-dlp-rajiko-781ce8e7a74aa19df8793a3f29176d82c44f6b6b.tar.gz yt-dlp-rajiko-781ce8e7a74aa19df8793a3f29176d82c44f6b6b.tar.bz2 yt-dlp-rajiko-781ce8e7a74aa19df8793a3f29176d82c44f6b6b.zip |
move ShareIE tests to test script
-rwxr-xr-x | misc/test_extractors.py | 36 | ||||
-rw-r--r-- | yt_dlp_plugins/extractor/radiko.py | 31 |
2 files changed, 34 insertions, 33 deletions
diff --git a/misc/test_extractors.py b/misc/test_extractors.py index 41dedb4..7c1a2c7 100755 --- a/misc/test_extractors.py +++ b/misc/test_extractors.py @@ -42,7 +42,7 @@ def get_test_timefields(airtime, release_time): -from yt_dlp_plugins.extractor.radiko import RadikoTimeFreeIE +from yt_dlp_plugins.extractor.radiko import RadikoTimeFreeIE, RadikoShareIE RadikoTimeFreeIE._TESTS = [] @@ -104,8 +104,40 @@ RadikoTimeFreeIE._TESTS.append({ }) +# testing 29-hour clock handling +airtime, release_time = get_latest_airtimes(now, WED, 0, 0, datetime.timedelta(minutes=55)) +share_timestring = (airtime - datetime.timedelta(days=1)).strftime("%Y%m%d") + "240000" -IEs = [RadikoTimeFreeIE] +RadikoShareIE._TESTS = [{ + "url": f"http://radiko.jp/share/?sid=FMT&t={share_timestring}", + "info_dict": { + "live_status": "was_live", + "ext": "m4a", + "id": f"FMT-{airtime.timestring()}", + + **get_test_timefields(airtime, release_time), + + "title": "JET STREAM", + "series": "JET STREAM", + "description": r"re:^JET STREAM・・・作家が描く世界への旅。[\s\S]+https://www.tfm.co.jp/f/jetstream/message$", + "chapters": list, + "thumbnail": "https://program-static.cf.radiko.jp/greinlrspi.jpg", + + "channel": "TOKYO FM", + "channel_id": "FMT", + "channel_url": "https://www.tfm.co.jp/", + "uploader": "TOKYO FM", + "uploader_id": "FMT", + "uploader_url": "https://www.tfm.co.jp/", + + "cast": ["福山雅治"], + "tags": ["福山雅治", "夜間飛行", "音楽との出会いが楽しめる", "朗読を楽しめる", "寝る前に聴きたい"], + }, + }] + + + +IEs = [RadikoTimeFreeIE, RadikoShareIE] import test.helper as th diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index c4e4846..2996290 100644 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -628,37 +628,6 @@ class RadikoSearchIE(InfoExtractor): class RadikoShareIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?radiko\.jp/share/" - _TESTS = [{ - # 29-hour time -> 24-hour time - "url": "http://radiko.jp/share/?sid=FMT&t=20240802240000", - "info_dict": { - "live_status": "was_live", - "ext": "m4a", - "id": "FMT-20240803000000", # the time given (24:00) works out to 00:00 the next day - - "title": "JET STREAM", - "series": "JET STREAM", - "description": "md5:c1a2172036ebb7a54eeafb47e0a08a50", - "chapters": "count:9", - "thumbnail": "https://program-static.cf.radiko.jp/greinlrspi.jpg", - - "upload_date": "20240802", - "timestamp": 1722610800.0, - "release_date": "20240802", - "release_timestamp": 1722614100.0, - "duration": 3300, - - "channel": "TOKYO FM", - "channel_id": "FMT", - "channel_url": "https://www.tfm.co.jp/", - "uploader": "TOKYO FM", - "uploader_id": "FMT", - "uploader_url": "https://www.tfm.co.jp/", - - "cast": ["福山雅治"], - "tags": ["福山雅治", "夜間飛行", "音楽との出会いが楽しめる", "朗読を楽しめる", "寝る前に聴きたい"], - } - }] def _real_extract(self, url): queries = parse_qs(url) |