mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-29 10:41:23 +01:00
Compare commits
3 Commits
7da9b5b126
...
8eb987d9ca
Author | SHA1 | Date | |
---|---|---|---|
|
8eb987d9ca | ||
|
172369e9f5 | ||
|
70ff5d5aa3 |
|
@ -1,5 +1,11 @@
|
|||
from .common import InfoExtractor
|
||||
from ..utils import format_field, parse_iso8601, traverse_obj
|
||||
from ..utils import (
|
||||
MEDIA_EXTENSIONS,
|
||||
determine_ext,
|
||||
parse_iso8601,
|
||||
traverse_obj,
|
||||
url_or_none,
|
||||
)
|
||||
|
||||
|
||||
class RinseFMBaseIE(InfoExtractor):
|
||||
|
@ -7,14 +13,18 @@ class RinseFMBaseIE(InfoExtractor):
|
|||
def _parse_entry(entry):
|
||||
return {
|
||||
**traverse_obj(entry, {
|
||||
'id': ('id'),
|
||||
'title': ('title'),
|
||||
'url': ('fileUrl'),
|
||||
'vcode': 'none',
|
||||
'id': ('id', {str}),
|
||||
'title': ('title', {str}),
|
||||
'url': ('fileUrl', {url_or_none}),
|
||||
'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}'}),
|
||||
}),
|
||||
'thumbnail': format_field(
|
||||
entry, [('featuredImage', 0, 'filename')], 'https://rinse.imgix.net/media/%s', default=None),
|
||||
'vcodec': 'none',
|
||||
'extractor_key': RinseFMIE.ie_key(),
|
||||
'extractor': RinseFMIE.IE_NAME,
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,7 +84,8 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
|
|||
|
||||
episodes = traverse_obj(
|
||||
self._search_nextjs_data(webpage, playlist_id),
|
||||
('props', 'pageProps', 'episodes', lambda _, v: v['fileUrl'].endswith('mp3')))
|
||||
('props', 'pageProps', 'episodes',
|
||||
lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio))
|
||||
|
||||
return self.playlist_result(
|
||||
self._entries(episodes), playlist_id, title, description=description)
|
||||
|
|
Loading…
Reference in New Issue
Block a user