Explorar el Código

[generic] Support YouTube swf embed (Fixes #2010)

Philipp Hagemeister hace 12 años
padre
commit
1f9da9049b
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      youtube_dl/extractor/generic.py

+ 5 - 2
youtube_dl/extractor/generic.py

@@ -233,8 +233,11 @@ class GenericIE(InfoExtractor):
             return self.url_result(surl, 'Vimeo')
             return self.url_result(surl, 'Vimeo')
 
 
         # Look for embedded YouTube player
         # Look for embedded YouTube player
-        matches = re.findall(
-            r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?youtube\.com/embed/.+?)\1', webpage)
+        matches = re.findall(r'''(?x)
+            (?:<iframe[^>]+?src=|embedSWF\(\s*)
+            (["\'])(?P<url>(?:https?:)?//(?:www\.)?youtube\.com/
+                (?:embed|v)/.+?)
+            \1''', webpage)
         if matches:
         if matches:
             urlrs = [self.url_result(unescapeHTML(tuppl[1]), 'Youtube')
             urlrs = [self.url_result(unescapeHTML(tuppl[1]), 'Youtube')
                      for tuppl in matches]
                      for tuppl in matches]