]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[facebook] Improve video selection (closes #11390)
authorSergey M․ <dstftw@gmail.com>
Sat, 10 Dec 2016 18:22:01 +0000 (01:22 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 10 Dec 2016 18:22:01 +0000 (01:22 +0700)
youtube_dl/extractor/facebook.py

index b4d38e5c258b830e192bcfa2639f2074d9217434..4de21baeb9f596dfb538d8451620d38a795cc9f6 100644 (file)
@@ -244,8 +244,10 @@ class FacebookIE(InfoExtractor):
             r'handleServerJS\(({.+})(?:\);|,")', webpage, 'server js data', default='{}'), video_id)
         for item in server_js_data.get('instances', []):
             if item[1][0] == 'VideoConfig':
-                video_data = item[2][0]['videoData']
-                break
+                video_item = item[2][0]
+                if video_item.get('video_id') == video_id:
+                    video_data = video_item['videoData']
+                    break
 
         if not video_data:
             if not fatal_if_no_video: