[onionstudios] Add generic embed extraction routine
authorSergey M․ <dstftw@gmail.com>
Wed, 24 Jun 2015 17:16:33 +0000 (23:16 +0600)
committerSergey M․ <dstftw@gmail.com>
Wed, 24 Jun 2015 17:16:33 +0000 (23:16 +0600)
youtube_dl/extractor/onionstudios.py

index d5d03fd443e2c68d7f71b41239638110bea4379a..8fa507dec7e3b8fc0e48bc679d03192a2cc63bf4 100644 (file)
@@ -27,6 +27,13 @@ class OnionStudiosIE(InfoExtractor):
         'only_matching': True,
     }]
 
+    @staticmethod
+    def _extract_url(webpage):
+        mobj = re.search(
+            r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?onionstudios\.com/embed.+?)\1', webpage)
+        if mobj:
+            return mobj.group('url')
+
     def _real_extract(self, url):
         video_id = self._match_id(url)