diff --git a/yt_dlp/extractor/nhk.py b/yt_dlp/extractor/nhk.py index 2dca5a05d0..0246511131 100644 --- a/yt_dlp/extractor/nhk.py +++ b/yt_dlp/extractor/nhk.py @@ -592,94 +592,80 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P[\da-zA-Z]+)_(?P[\da-zA-Z]+)(?:_(?P[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=0449_01_4003239', - 'skip': 'Episode expired on 2024-06-09', + 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=8Q3V972NM8_01_4178419', + 'skip': 'Episode expired on 2025-03-30', 'info_dict': { - 'title': 'ジャズ・トゥナイト ジャズ「Night and Day」特集', - 'id': '0449_01_4003239', + 'title': 'ジャズ・トゥナイト 放送記念日特集 (2) 100年前のジャズを聞こう!', + 'id': '8Q3V972NM8_01_4178419', 'ext': 'm4a', - 'uploader': 'NHK FM 東京', - 'description': 'md5:ad05f3c3f3f6e99b2e69f9b5e49551dc', + 'description': 'md5:35e18396c738987a8ab621ae5dfe354e', + 'uploader': 'NHK FM・東京', + 'channel': 'NHK FM・東京', + 'duration': 7200.0, + 'thumbnail': 'https://www.nhk.jp/static/assets/images/radioseries/rs/8Q3V972NM8/8Q3V972NM8-eyecatch_26f2ac4b4f380ab786a43cd35f0902ee.jpg', + 'cast': ['大友良英'], 'series': 'ジャズ・トゥナイト', - 'channel': 'NHK FM 東京', - 'thumbnail': 'https://www.nhk.or.jp/prog/img/449/g449.jpg', - 'upload_date': '20240601', - 'series_id': '0449_01', - 'release_date': '20240601', - 'timestamp': 1717257600, - 'release_timestamp': 1717250400, + 'series_id': '8Q3V972NM8', + 'episode': '放送記念日特集 (2) 100年前のジャズを聞こう!', + 'episode_id': '4LR4ZN6JX1', + 'timestamp': 1742659203, + 'upload_date': '20250322', + 'release_timestamp': 1742652003, + 'release_date': '20250322', + 'categories': ['音楽', 'ジャズ・フュージョン'], }, }, { # playlist, airs every weekday so it should _hopefully_ be okay forever - 'url': 'https://www.nhk.or.jp/radio/ondemand/detail.html?p=0458_01', + 'url': 'https://www.nhk.or.jp/radio/ondemand/detail.html?p=Z9L1V2M24L_01', 'info_dict': { - 'id': '0458_01', + 'id': 'Z9L1V2M24L_01', 'title': 'ベストオブクラシック', 'description': '世界中の上質な演奏会をじっくり堪能する本格派クラシック番組。', - 'thumbnail': 'https://www.nhk.or.jp/prog/img/458/g458.jpg', - 'series_id': '0458_01', + 'thumbnail': 'https://www.nhk.jp/static/assets/images/radioseries/rs/Z9L1V2M24L/Z9L1V2M24L-eyecatch_83ed28b4782907998875965fee60a351.jpg', + 'series_id': 'Z9L1V2M24L_01', 'uploader': 'NHK FM', 'channel': 'NHK FM', 'series': 'ベストオブクラシック', }, 'playlist_mincount': 3, - }, { - # one with letters in the id - 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=F683_01_3910688', - 'note': 'Expires on 2025-03-31', - 'info_dict': { - 'id': 'F683_01_3910688', - 'ext': 'm4a', - 'title': '夏目漱石「文鳥」第1回', - 'series': '【らじる文庫】夏目漱石「文鳥」(全4回)', - 'series_id': 'F683_01', - 'description': '朗読:浅井理アナウンサー', - 'thumbnail': 'https://www.nhk.or.jp/radioondemand/json/F683/img/roudoku_05_rod_640.jpg', - 'upload_date': '20240106', - 'release_date': '20240106', - 'uploader': 'NHK R1', - 'release_timestamp': 1704511800, - 'channel': 'NHK R1', - 'timestamp': 1704512700, - }, - 'expected_warnings': ['Unable to download JSON metadata', - 'Failed to get extended metadata. API returned Error 1: Invalid parameters'], }, { # news - 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=F261_01_4012173', + 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=F261_01_4178426', + 'skip': 'Expires on 2025-03-23', 'info_dict': { - 'id': 'F261_01_4012173', + 'id': 'F261_01_4178426', 'ext': 'm4a', - 'channel': 'NHKラジオ第1', + 'title': '午前8時のNHKニュース', 'uploader': 'NHKラジオ第1', - 'series': 'NHKラジオニュース', - 'title': '午前0時のNHKニュース', + 'channel': 'NHKラジオ第1', 'thumbnail': 'https://www.nhk.or.jp/radioondemand/json/F261/img/RADIONEWS_640.jpg', - 'release_timestamp': 1718290800, - 'release_date': '20240613', - 'timestamp': 1718291400, - 'upload_date': '20240613', + 'series': 'NHKラジオニュース', + 'timestamp': 1742684700, + 'upload_date': '20250322', + 'release_timestamp': 1742684400, + 'release_date': '20250322', + }, }, { # fallback when extended metadata fails - 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=2834_01_4009298', - 'skip': 'Expires on 2024-06-07', + 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=J8792PY43V_14_4177121', + 'skip': 'Expires on 2025-04-14', 'info_dict': { - 'id': '2834_01_4009298', - 'title': 'まち☆キラ!開成町特集', + 'id': 'J8792PY43V_14_4177121', 'ext': 'm4a', - 'release_date': '20240531', - 'upload_date': '20240531', - 'series': 'はま☆キラ!', - 'thumbnail': 'https://www.nhk.or.jp/prog/img/2834/g2834.jpg', - 'channel': 'NHK R1,FM', - 'description': '', - 'timestamp': 1717123800, - 'uploader': 'NHK R1,FM', - 'release_timestamp': 1717120800, - 'series_id': '2834_01', + 'title': '「白い蝶[ちょう]を探してみよう」いきもの☆いろいろ', + 'description': '海野 和男(昆虫写真家)', + 'uploader': 'NHK R1', + 'channel': 'NHK R1', + 'thumbnail': 'https://www.nhk.or.jp/radioondemand/json/J8792PY43V/img/corner/box_26_thumbnail.jpg', + 'series': 'マイあさ! いきもの☆いろいろ', + 'series_id': 'J8792PY43V_14', + 'timestamp': 1741985700, + 'upload_date': '20250314', + 'release_timestamp': 1741982400, + 'release_date': '20250314', }, - 'expected_warnings': ['Failed to get extended metadata. API returned empty list.'], + 'expected_warnings': ['Failed to download extended metadata: HTTP Error 404: Not Found'], }] _API_URL_TMPL = None