[ie/ARD] Review feedback

Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
This commit is contained in:
marieell 2024-08-13 00:15:25 +02:00
parent 4e17e8eec2
commit 75ff02cf4e

View File

@ -627,7 +627,8 @@ class ARDAudiothekIE(InfoExtractor):
} }
}''' }'''
_QUERY_ITEM = '''item(id: "%s") { _QUERY_ITEM = '''\
item(id: "%s") {
audioList { audioList {
href href
distributionType distributionType
@ -671,12 +672,10 @@ def _real_extract(self, url):
entries.append(self.url_result( entries.append(self.url_result(
episode['url'], episode['url'],
ie=ARDAudiothekIE.ie_key())) ie=ARDAudiothekIE.ie_key()))
data = self.playlist_result(entries, video_id, playlist_title=display_id) return self.playlist_result(entries, video_id, playlist_title=display_id, **traverse_obj(playlist_info, {
data.update({ 'title': ('title', {str}),
'title': playlist_info.get('title'), 'description': ('description', {str}),
'description': playlist_info.get('description'), }))
})
return data
item = self.graphql_query(display_id, self._QUERY_ITEM % video_id)['item'] item = self.graphql_query(display_id, self._QUERY_ITEM % video_id)['item']
audio_list = item.get('audioList', []) audio_list = item.get('audioList', [])
@ -684,12 +683,12 @@ def _real_extract(self, url):
'display_id': display_id, 'display_id': display_id,
'formats': [{'url': x['href'], 'format_id': x['distributionType']} for x in audio_list], 'formats': [{'url': x['href'], 'format_id': x['distributionType']} for x in audio_list],
'id': video_id, 'id': video_id,
**traverse_obj(item, ({ **traverse_obj(item, {
'description': 'synopsis', 'description': ('synopsis', {str}),
'duration': ('duration', {int_or_none}), 'duration': ('duration', {int_or_none}),
'series': ('show', 'title'), 'series': ('show', 'title'),
'thumbnail': ('image', 'url', {url_or_none}), 'thumbnail': ('image', 'url', {url_or_none}),
'timestamp': ('startDate', {parse_iso8601}), 'timestamp': ('startDate', {parse_iso8601}),
'title': 'title', 'title': ('title', {str}),
})), }),
} }