mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 22:21:17 +01:00
[facebook] Improve video selection (closes #11390)
This commit is contained in:
parent
6ca478d44a
commit
19b4900b7b
|
@ -244,7 +244,9 @@ def _extract_from_url(self, url, video_id, fatal_if_no_video=True):
|
||||||
r'handleServerJS\(({.+})(?:\);|,")', webpage, 'server js data', default='{}'), video_id)
|
r'handleServerJS\(({.+})(?:\);|,")', webpage, 'server js data', default='{}'), video_id)
|
||||||
for item in server_js_data.get('instances', []):
|
for item in server_js_data.get('instances', []):
|
||||||
if item[1][0] == 'VideoConfig':
|
if item[1][0] == 'VideoConfig':
|
||||||
video_data = item[2][0]['videoData']
|
video_item = item[2][0]
|
||||||
|
if video_item.get('video_id') == video_id:
|
||||||
|
video_data = video_item['videoData']
|
||||||
break
|
break
|
||||||
|
|
||||||
if not video_data:
|
if not video_data:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user