]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[generic] Make sure Wistia embed URLs contain the protocol (Closes #3977)
authorNaglis Jonaitis <njonaitis@gmail.com>
Fri, 17 Oct 2014 22:52:55 +0000 (01:52 +0300)
committerNaglis Jonaitis <njonaitis@gmail.com>
Fri, 17 Oct 2014 22:55:21 +0000 (01:55 +0300)
Also, improve detection (Addresses #3662)

youtube_dl/extractor/generic.py

index 158dc95a5a5380ff56414c2832308f3441cd2a66..9057a6beb97a0d0cc2fca33d1d0ccc30c07b8101 100644 (file)
@@ -654,15 +654,17 @@ class GenericIE(InfoExtractor):
         match = re.search(
             r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage)
         if match:
+            embed_url = self._proto_relative_url(
+                unescapeHTML(match.group('url')))
             return {
                 '_type': 'url_transparent',
-                'url': unescapeHTML(match.group('url')),
+                'url': embed_url,
                 'ie_key': 'Wistia',
                 'uploader': video_uploader,
                 'title': video_title,
                 'id': video_id,
             }
-        match = re.search(r'(?:id=["\']wistia_|data-wistiaid=["\']|Wistia\.embed\(["\'])(?P<id>[^"\']+)', webpage)
+        match = re.search(r'(?:id=["\']wistia_|data-wistia-?id=["\']|Wistia\.embed\(["\'])(?P<id>[^"\']+)', webpage)
         if match:
             return {
                 '_type': 'url_transparent',