Skip to content

Commit

Permalink
use aSmartPhone7a stream API
Browse files Browse the repository at this point in the history
this API seemingly always gives "happy path" streams:
The live streams work perfectly fine with ffmpeg.
The catch-up isn't streamed as-live, it's regular non-live hls that
works with yt-dlp's hls downloader (though annoyingly not with mpv).
  • Loading branch information
garret1317 committed Sep 28, 2023
1 parent 5aa435f commit e9117f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yt_dlp/extractor/radiko.py
Expand Up @@ -116,7 +116,7 @@ def _find_program(self, video_id, station, cursor):

def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token, area_id, query):
m3u8_playlist_data = self._download_xml(
f'https://radiko.jp/v3/station/stream/pc_html5/{station}.xml', video_id,
f'https://radiko.jp/v3/station/stream/aSmartPhone7a/{station}.xml', video_id,
note='Downloading stream information')

formats = []
Expand All @@ -143,7 +143,7 @@ def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token,
domain = urllib.parse.urlparse(playlist_url).netloc
subformats = self._extract_m3u8_formats(
playlist_url, video_id, ext='m4a',
live=True, fatal=False, m3u8_id=domain,
fatal=False, m3u8_id=domain,
note=f'Downloading m3u8 information from {domain}',
headers={
'X-Radiko-AreaId': area_id,
Expand Down Expand Up @@ -190,7 +190,7 @@ def _real_extract(self, url):
'uploader': try_call(lambda: station_program.find('.//name').text),
'uploader_id': station,
'timestamp': vid_int,
'is_live': True,
'live_status': 'was_live',
'formats': self._extract_formats(
video_id=video_id, station=station, is_onair=False,
ft=ft, cursor=vid_int, auth_token=auth_token, area_id=area_id,
Expand Down

0 comments on commit e9117f0

Please sign in to comment.