[generic] Add support for embeded TED videos
authoranovicecodemonkey <anovicecodemonkey13435@mailinator.com>
Wed, 19 Mar 2014 14:26:32 +0000 (00:56 +1030)
committeranovicecodemonkey <anovicecodemonkey13435@mailinator.com>
Wed, 19 Mar 2014 14:26:32 +0000 (00:56 +1030)
youtube_dl/extractor/generic.py

index 5a493314699b131febf06e4af25695b3f862cded..273a3e282028081a397b94c5226f89645f248c91 100644 (file)
@@ -487,6 +487,13 @@ class GenericIE(InfoExtractor):
         if mobj is None:
             # Broaden the search a little bit: JWPlayer JS loader
             mobj = re.search(r'[^A-Za-z0-9]?file["\']?:\s*["\'](http(?![^\'"]+\.[0-9]+[\'"])[^\'"]+)["\']', webpage)
+
+        # Look for embedded TED player
+        mobj = re.search(
+            r'<iframe[^>]+?src=(["\'])(?P<url>http://embed\.ted\.com/.+?)\1', webpage)
+        if mobj is not None:
+            return self.url_result(mobj.group('url'), 'TED')
+
         if mobj is None:
             # Try to find twitter cards info
             mobj = re.search(r'<meta (?:property|name)="twitter:player:stream" (?:content|value)="(.+?)"', webpage)