Compare commits

..

No commits in common. "8eb987d9ca5325d8deec260892ee4506d2fb76ec" and "7da9b5b126caac3c52c79302086753ca8d8cdc10" have entirely different histories.

View File

@ -1,11 +1,5 @@
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ( from ..utils import format_field, parse_iso8601, traverse_obj
MEDIA_EXTENSIONS,
determine_ext,
parse_iso8601,
traverse_obj,
url_or_none,
)
class RinseFMBaseIE(InfoExtractor): class RinseFMBaseIE(InfoExtractor):
@ -13,18 +7,14 @@ class RinseFMBaseIE(InfoExtractor):
def _parse_entry(entry): def _parse_entry(entry):
return { return {
**traverse_obj(entry, { **traverse_obj(entry, {
'id': ('id', {str}), 'id': ('id'),
'title': ('title', {str}), 'title': ('title'),
'url': ('fileUrl', {url_or_none}), 'url': ('fileUrl'),
'vcode': 'none',
'release_timestamp': ('episodeDate', {parse_iso8601}), 'release_timestamp': ('episodeDate', {parse_iso8601}),
'thumbnail': ('featuredImage', 0, 'filename', {str},
{lambda x: x and f'https://rinse.imgix.net/media/{x}'}),
'webpage_url': ('slug', {str},
{lambda x: x and f'https://rinse.fm/episodes/{x}'}),
}), }),
'vcodec': 'none', 'thumbnail': format_field(
'extractor_key': RinseFMIE.ie_key(), entry, [('featuredImage', 0, 'filename')], 'https://rinse.imgix.net/media/%s', default=None),
'extractor': RinseFMIE.IE_NAME,
} }
@ -84,8 +74,7 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
episodes = traverse_obj( episodes = traverse_obj(
self._search_nextjs_data(webpage, playlist_id), self._search_nextjs_data(webpage, playlist_id),
('props', 'pageProps', 'episodes', ('props', 'pageProps', 'episodes', lambda _, v: v['fileUrl'].endswith('mp3')))
lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio))
return self.playlist_result( return self.playlist_result(
self._entries(episodes), playlist_id, title, description=description) self._entries(episodes), playlist_id, title, description=description)