Skip to content

Commit

Permalink
[ie/radiko] Extract unique id values (yt-dlp#10726)
Browse files Browse the repository at this point in the history
Authored by: garret1317
  • Loading branch information
garret1317 authored Aug 19, 2024
1 parent a7d3235 commit c8d096c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions yt_dlp/extractor/radiko.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ..utils import (
ExtractorError,
clean_html,
join_nonempty,
time_seconds,
try_call,
unified_timestamp,
Expand Down Expand Up @@ -167,7 +168,7 @@ def _extract_performers(self, prog):


class RadikoIE(RadikoBaseIE):
_VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/ts/(?P<station>[A-Z0-9-]+)/(?P<id>\d+)'
_VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/ts/(?P<station>[A-Z0-9-]+)/(?P<timestring>\d+)'

_TESTS = [{
# QRR (文化放送) station provides <desc>
Expand All @@ -183,8 +184,9 @@ class RadikoIE(RadikoBaseIE):
}]

def _real_extract(self, url):
station, video_id = self._match_valid_url(url).groups()
vid_int = unified_timestamp(video_id, False)
station, timestring = self._match_valid_url(url).group('station', 'timestring')
video_id = join_nonempty(station, timestring)
vid_int = unified_timestamp(timestring, False)
prog, station_program, ft, radio_begin, radio_end = self._find_program(video_id, station, vid_int)

auth_token, area_id = self._auth_client()
Expand All @@ -207,7 +209,7 @@ def _real_extract(self, url):
'ft': radio_begin,
'end_at': radio_end,
'to': radio_end,
'seek': video_id,
'seek': timestring,
},
),
}
Expand Down

0 comments on commit c8d096c

Please sign in to comment.