[generic] Add support for nytimes embeds (Closes #5234)
authorSergey M․ <dstftw@gmail.com>
Thu, 19 Mar 2015 15:26:57 +0000 (21:26 +0600)
committerSergey M․ <dstftw@gmail.com>
Thu, 19 Mar 2015 15:26:57 +0000 (21:26 +0600)
youtube_dl/extractor/generic.py

index dc5755d1240a493ba7a9ab85e16c67ab4881edac..8716e4503ad4ae61a57745ec1eafe96fe5e25ddc 100644 (file)
@@ -1006,6 +1006,13 @@ class GenericIE(InfoExtractor):
         if mobj is not None:
             return self.url_result(mobj.group('url'))
 
+        # Look for NYTimes player
+        mobj = re.search(
+            r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//graphics8\.nytimes\.com/bcvideo/[^/]+/iframe/embed\.html.+?)\1>',
+            webpage)
+        if mobj is not None:
+            return self.url_result(mobj.group('url'))
+
         # Look for Ooyala videos
         mobj = (re.search(r'player\.ooyala\.com/[^"?]+\?[^"]*?(?:embedCode|ec)=(?P<ec>[^"&]+)', webpage) or
                 re.search(r'OO\.Player\.create\([\'"].*?[\'"],\s*[\'"](?P<ec>.{32})[\'"]', webpage) or