]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[facebook] Fix for new handleServerJS syntax (closes #10846)
authorYen Chi Hsuan <yan12125@gmail.com>
Fri, 7 Oct 2016 12:04:49 +0000 (20:04 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Fri, 7 Oct 2016 12:04:49 +0000 (20:04 +0800)
According to the dump file in #10846, handleServerJS() now accepts
an optional second argument. It's a string from available dump files.

ChangeLog
youtube_dl/extractor/facebook.py

index 3aa4d67f592a154f7c3297194b27b1ab51d035c6..7aa0787cab7d213cc1503c5f6db80036040cfe02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 version <unreleased>
 
 Extractors
+* [facebook] Fix video extraction (#10846)
 + [commonprotocols] Support direct MMS links (#10838)
 
 
index 3a220e9959f034224b42d199666b0523598bd8d9..801573459d21118d08852b1c9745f34d65711d7d 100644 (file)
@@ -258,7 +258,7 @@ class FacebookIE(InfoExtractor):
 
         if not video_data:
             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', []):
                 if item[1][0] == 'VideoConfig':
                     video_data = video_data_list2dict(item[2][0]['videoData'])