This commit is contained in:
Kyle Gonsalves 2024-04-24 11:56:51 -07:00
parent ab1cfa399b
commit b0593ecfa4

View file

@ -1397,20 +1397,23 @@ def parse_media(media):
'tbr': ('bitrate', {k_int_or_none}),
}, {lambda u: u.get('url') and u}))
if formats:
entry = merge_dicts({
entry = {
'id': block_id,
'display_id': playlist_id,
'formats': formats,
}, traverse_obj(simorgh_data, ('pageData', 'promo', {
'description': ('summary', {str}),
})), traverse_obj(model, {
**traverse_obj(simorgh_data, (
'pageData', 'promo', {
'description': ('summary', {str}),
}
)),
**traverse_obj(model, {
'title': ('title', {str}),
'thumbnail': ('imageUrl', {lambda u: urljoin(url, u.replace('$recipe', 'raw'))}),
'description': (
'synopses', ('long', 'medium', 'short'), {str}, any),
'timestamp': ('firstPublished', {k_int_or_none}),
}),
)
}
done = True
if entry:
entries.append(entry)