]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[JWPlatform] Support iframes
authorJohn Hawkinson <jhawk@mit.edu>
Wed, 22 Nov 2017 16:47:02 +0000 (11:47 -0500)
committerYen Chi Hsuan <yan12125@gmail.com>
Fri, 24 Nov 2017 13:39:55 +0000 (21:39 +0800)
Support content.jwplatform... src attributes inside <iframe> tags in
addition to <script> tags. Just a regexp change.

Add a test (currently Generic_72).

youtube_dl/extractor/generic.py
youtube_dl/extractor/jwplatform.py

index 31564e550b01eb55bf26fabc61cc5b1e93dcc468..8efe681064831c37ac7ce38a36543e25e4532727 100644 (file)
@@ -1136,6 +1136,18 @@ class GenericIE(InfoExtractor):
                 'skip_download': True,
             }
         },
+        {
+            # JWPlatform iframe
+            'url': 'https://www.mediaite.com/tv/dem-senator-claims-gary-cohn-faked-a-bad-connection-during-trump-call-to-get-him-off-the-phone/',
+            'md5': 'ca00a040364b5b439230e7ebfd02c4e9',
+            'info_dict': {
+                'id': 'O0c5JcKT',
+                'ext': 'mp4',
+                'upload_date': '20171122',
+                'timestamp': 1511366290,
+                'title': 'Dem Senator Claims Gary Cohn Faked a Bad Connection During Trump Call to Get Him Off the Phone',
+            },
+        },
         {
             # Video.js embed, multiple formats
             'url': 'http://ortcam.com/solidworks-урок-6-настройка-чертежа_33f9b7351.html',
index 33d55f7706d79e0b87a9830ae9abce3de6f33826..4e74eafac707d8b3c0c4a21cd3d6bcfaf24185ed 100644 (file)
@@ -24,7 +24,7 @@ class JWPlatformIE(InfoExtractor):
     @staticmethod
     def _extract_url(webpage):
         mobj = re.search(
-            r'<script[^>]+?src=["\'](?P<url>(?:https?:)?//content.jwplatform.com/players/[a-zA-Z0-9]{8})',
+            r'<(script|iframe)[^>]+?src=["\'](?P<url>(?:https?:)?//content.jwplatform.com/players/[a-zA-Z0-9]{8})',
             webpage)
         if mobj:
             return mobj.group('url')