facebook: also download lq videos
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 18 Feb 2013 22:12:48 +0000 (23:12 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 18 Feb 2013 22:12:48 +0000 (23:12 +0100)
youtube_dl/InfoExtractors.py

index d7ddf4e37b1a8e1103391ac3cc1aeed483d584c2..36f025078428df9a86424555e953dcdda77e91e9 100755 (executable)
@@ -2098,6 +2098,10 @@ class FacebookIE(InfoExtractor):
         params_raw = compat_urllib_parse.unquote(data['params'])
         params = json.loads(params_raw)
         video_url = params['hd_src']
+        if not video_url:
+            video_url = params['sd_src']
+        if not video_url:
+            raise ExtractorError(u'Cannot find video URL')
         video_duration = int(params['video_duration'])
 
         m = re.search('<h2 class="uiHeaderTitle">([^<]+)</h2>', webpage)