mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-10 14:40:04 +01:00
[ie/radiko] Extract performers as cast
instead of artist
The site refers to radio show hosts as performers Authored by: bashonly
This commit is contained in:
parent
ba1b02ee2c
commit
d1f458961d
@ -162,10 +162,8 @@ class RadikoBaseIE(InfoExtractor):
|
|||||||
return formats
|
return formats
|
||||||
|
|
||||||
def _extract_performers(self, prog):
|
def _extract_performers(self, prog):
|
||||||
performers = traverse_obj(prog, (
|
return traverse_obj(prog, (
|
||||||
'pfm/text()', ..., {lambda x: re.split(r'[//、 ,,]', x)}, ..., {str.strip}))
|
'pfm/text()', ..., {lambda x: re.split(r'[//、 ,,]', x)}, ..., {str.strip})) or None
|
||||||
# TODO: change 'artist' fields to 'artists' and return traversal list instead of str
|
|
||||||
return ', '.join(performers) or None
|
|
||||||
|
|
||||||
|
|
||||||
class RadikoIE(RadikoBaseIE):
|
class RadikoIE(RadikoBaseIE):
|
||||||
@ -194,7 +192,7 @@ class RadikoIE(RadikoBaseIE):
|
|||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': try_call(lambda: prog.find('title').text),
|
'title': try_call(lambda: prog.find('title').text),
|
||||||
'artist': self._extract_performers(prog),
|
'cast': self._extract_performers(prog),
|
||||||
'description': clean_html(try_call(lambda: prog.find('info').text)),
|
'description': clean_html(try_call(lambda: prog.find('info').text)),
|
||||||
'uploader': try_call(lambda: station_program.find('.//name').text),
|
'uploader': try_call(lambda: station_program.find('.//name').text),
|
||||||
'uploader_id': station,
|
'uploader_id': station,
|
||||||
@ -253,7 +251,7 @@ class RadikoRadioIE(RadikoBaseIE):
|
|||||||
return {
|
return {
|
||||||
'id': station,
|
'id': station,
|
||||||
'title': title,
|
'title': title,
|
||||||
'artist': self._extract_performers(prog),
|
'cast': self._extract_performers(prog),
|
||||||
'description': description,
|
'description': description,
|
||||||
'uploader': station_name,
|
'uploader': station_name,
|
||||||
'uploader_id': station,
|
'uploader_id': station,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user