Compare commits

..

No commits in common. "d6aa8c235d2e7d9374f79ec73af23a3859c76bea" and "5977782142ca7e41240f07202cc9b8dcc087b401" have entirely different histories.

2 changed files with 17 additions and 24 deletions

View File

@ -98,7 +98,7 @@ class JTBCIE(InfoExtractor):
formats = [] formats = []
for stream_url in traverse_obj(playback_data, ('sources', 'HLS', ..., 'file', {url_or_none})): for stream_url in traverse_obj(playback_data, ('sources', 'HLS', ..., 'file', {url_or_none})):
stream_url = re.sub(r'/playlist_pd\d+\.m3u8', '/playlist.m3u8', stream_url) stream_url = re.sub(r'/playlist(?:_pd\d+)?\.m3u8', '/index.m3u8', stream_url)
formats.extend(self._extract_m3u8_formats(stream_url, video_id, fatal=False)) formats.extend(self._extract_m3u8_formats(stream_url, video_id, fatal=False))
metadata = self._download_json( metadata = self._download_json(

View File

@ -3,14 +3,12 @@ from ..utils import (
MEDIA_EXTENSIONS, MEDIA_EXTENSIONS,
determine_ext, determine_ext,
parse_iso8601, parse_iso8601,
traverse_obj,
url_or_none, url_or_none,
) )
from ..utils.traversal import traverse_obj
class RinseFMBaseIE(InfoExtractor): class RinseFMBaseIE(InfoExtractor):
_API_BASE = 'https://rinse.fm/api/query/v1'
@staticmethod @staticmethod
def _parse_entry(entry): def _parse_entry(entry):
return { return {
@ -47,10 +45,8 @@ class RinseFMIE(RinseFMBaseIE):
def _real_extract(self, url): def _real_extract(self, url):
display_id = self._match_id(url) display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
entry = self._download_json( entry = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['entry']
f'{self._API_BASE}/episodes/{display_id}', display_id,
note='Downloading episode data from API')['entry']
return self._parse_entry(entry) return self._parse_entry(entry)
@ -62,35 +58,32 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
'info_dict': { 'info_dict': {
'id': 'resources', 'id': 'resources',
'title': '[re]sources', 'title': '[re]sources',
'description': 'md5:fd6a7254e8273510e6d49fbf50edf392', 'description': '[re]sources est un label parisien piloté par le DJ et producteur Tommy Kid.',
}, },
'playlist_mincount': 40, 'playlist_mincount': 40,
}, { }, {
'url': 'https://www.rinse.fm/shows/esk', 'url': 'https://rinse.fm/shows/ivy/',
'info_dict': { 'info_dict': {
'id': 'esk', 'id': 'ivy',
'title': 'Esk', 'title': '[IVY]',
'description': 'md5:5893d7c1d411ae8dea7fba12f109aa98', 'description': 'A dedicated space for DNB/Turbo House and 4x4.',
}, },
'playlist_mincount': 139, 'playlist_mincount': 7,
}] }]
def _entries(self, data): def _entries(self, data):
for episode in traverse_obj(data, ( for episode in traverse_obj(data, (
'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio), 'props', 'pageProps', 'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
): ):
yield self._parse_entry(episode) yield self._parse_entry(episode)
def _real_extract(self, url): def _real_extract(self, url):
playlist_id = self._match_id(url) playlist_id = self._match_id(url)
webpage = self._download_webpage(url, playlist_id)
api_data = self._download_json( title = self._og_search_title(webpage) or self._html_search_meta('title', webpage)
f'{self._API_BASE}/shows/{playlist_id}', playlist_id, description = self._og_search_description(webpage) or self._html_search_meta(
note='Downloading show data from API') 'description', webpage)
data = self._search_nextjs_data(webpage, playlist_id)
return self.playlist_result( return self.playlist_result(
self._entries(api_data), playlist_id, self._entries(data), playlist_id, title, description=description)
**traverse_obj(api_data, ('entry', {
'title': ('title', {str}),
'description': ('description', {str}),
})))