1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-27 10:56:48 +01:00

[facebook] Fix for new handleServerJS syntax (closes #10846)

According to the dump file in #10846, handleServerJS() now accepts
an optional second argument. It's a string from available dump files.
This commit is contained in:
Yen Chi Hsuan 2016-10-07 20:04:49 +08:00
parent 85bcdd081c
commit 38588ab977
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
version <unreleased> version <unreleased>
Extractors Extractors
* [facebook] Fix video extraction (#10846)
+ [commonprotocols] Support direct MMS links (#10838) + [commonprotocols] Support direct MMS links (#10838)

View File

@ -258,7 +258,7 @@ class FacebookIE(InfoExtractor):
if not video_data: if not video_data:
server_js_data = self._parse_json(self._search_regex( server_js_data = self._parse_json(self._search_regex(
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 = video_data_list2dict(item[2][0]['videoData']) video_data = video_data_list2dict(item[2][0]['videoData'])