Skip to content

Commit

Permalink
Try for timestamp, description from window.__INITIAL_DATA__ pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkf committed Feb 5, 2022
1 parent 92d73ef commit 6d4932f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion youtube_dl/extractor/bbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,10 @@ def parse_media(media):
if name == 'media-experience':
parse_media(try_get(resp, lambda x: x['data']['initialItem']['mediaItem'], dict))
elif name == 'article':
for block in (try_get(resp, lambda x: x['data']['blocks'], list) or []):
for block in (try_get(resp,
(lambda x: x['data']['blocks'],
lambda x: x['data']['content']['model']['blocks'],),
list) or []):
if block.get('type') != 'media':
continue
parse_media(block.get('model'))
Expand Down

0 comments on commit 6d4932f

Please sign in to comment.