mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
Update bbc.py
This commit is contained in:
parent
40caf37ad0
commit
009cf65c74
@ -916,16 +916,16 @@ class BBCIE(BBCCoUkIE):
|
||||
for key in initial_data['data']:
|
||||
data = initial_data['data'][key].get('data')
|
||||
if data and isinstance(data, dict):
|
||||
mediaItem = None
|
||||
mediaItems = []
|
||||
initialItem = data.get('initialItem')
|
||||
blocks = data.get('blocks')
|
||||
if initialItem:
|
||||
mediaItem = initialItem.get('mediaItem')
|
||||
elif blocks:
|
||||
mediaItems.append(initialItem.get('mediaItem'))
|
||||
if blocks:
|
||||
for block in blocks:
|
||||
if block.get('type') == 'media':
|
||||
mediaItem = block.get('model')
|
||||
if mediaItem:
|
||||
mediaItems.append(block.get('model'))
|
||||
for mediaItem in mediaItems:
|
||||
title = mediaItem['title']['content'] if mediaItem.get('title') else mediaItem.get('caption')
|
||||
description = '\n'.join([block['model']['text'] for block in mediaItem['summary']['blocks']]) if mediaItem.get('summary') else None
|
||||
programme_id = mediaItem['media']['items'][0]['id']
|
||||
|
Loading…
Reference in New Issue
Block a user