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 = []
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))
metadata = self._download_json(

View File

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