]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[extractor/generic] Add support for async wistia embeds (Closes #9549)
authorSergey M․ <dstftw@gmail.com>
Fri, 20 May 2016 15:33:31 +0000 (21:33 +0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 20 May 2016 15:33:31 +0000 (21:33 +0600)
youtube_dl/extractor/generic.py

index a6b1e23e3604850a80ef5a635dc849488dd9e4c6..632d7b5f01a612d1fb5e33ddbfc845d09ca6e034 100644 (file)
@@ -1563,6 +1563,15 @@ class GenericIE(InfoExtractor):
                 'id': match.group('id')
             }
 
+        match = re.search(
+            r'''(?sx)
+                <script[^>]+src=(["'])(?:https?:)?//fast\.wistia\.com/assets/external/E-v1\.js\1[^>]*>.*?
+                <div[^>]+class=(["']).*?\bwistia_async_(?P<id>[a-z0-9]+)\b.*?\2
+            ''', webpage)
+        if match:
+            return self.url_result(self._proto_relative_url(
+                'wistia:%s' % match.group('id')), 'Wistia')
+
         # Look for SVT player
         svt_url = SVTIE._extract_url(webpage)
         if svt_url: