summaryrefslogtreecommitdiffhomepage
path: root/youtube_dl
diff options
context:
space:
mode:
authortetra-eder <[email protected]>2017-08-11 17:00:39 +0200
committerSergey M <[email protected]>2017-08-11 22:00:39 +0700
commit41918eaa5ce1225f7e0a94882e7c77919342210d (patch)
tree3cf40f06bfc13e89652a5b9457009f18aa3caeb4 /youtube_dl
parent6ed99754bb6074454b5d4875cc7b8b442e763ec5 (diff)
downloadyoutube-dl-41918eaa5ce1225f7e0a94882e7c77919342210d.tar.gz
youtube-dl-41918eaa5ce1225f7e0a94882e7c77919342210d.zip
[generic] Add support for vzaar embeds
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/generic.py17
-rw-r--r--youtube_dl/extractor/vzaar.py8
2 files changed, 25 insertions, 0 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index 34e814988..51acead66 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -98,6 +98,7 @@ from .wistia import WistiaIE
from .mediaset import MediasetIE
from .joj import JojIE
from .megaphone import MegaphoneIE
+from .vzaar import VzaarIE
class GenericIE(InfoExtractor):
@@ -1840,6 +1841,16 @@ class GenericIE(InfoExtractor):
'title': 'Стас Намин: «Мы нарушили девственность Кремля»',
},
},
+ {
+ # vzaar embed
+ 'url': 'http://www.xruniversity.com/bdsm-lets-begin-melissa-moore/',
+ 'md5': 'cddc9fb8a8644a0a7742149eee95080b',
+ 'info_dict': {
+ 'id': '11002506',
+ 'ext': 'mp4',
+ 'title': 'XR-U SHOW: Ready Player Fuck - EP. 61',
+ },
+ },
# {
# # TODO: find another test
# # http://schema.org/VideoObject
@@ -2781,6 +2792,12 @@ class GenericIE(InfoExtractor):
return self.playlist_from_matches(
videopress_urls, video_id, video_title, ie=VideoPressIE.ie_key())
+ # Look for vzaar embeds
+ vzaar_urls = VzaarIE._extract_urls(webpage)
+ if vzaar_urls:
+ return self.playlist_from_matches(
+ vzaar_urls, video_id, video_title, ie=VzaarIE.ie_key())
+
# Look for Rutube embeds
rutube_urls = RutubeIE._extract_urls(webpage)
if rutube_urls:
diff --git a/youtube_dl/extractor/vzaar.py b/youtube_dl/extractor/vzaar.py
index b270f08d1..02fcd52c7 100644
--- a/youtube_dl/extractor/vzaar.py
+++ b/youtube_dl/extractor/vzaar.py
@@ -1,6 +1,8 @@
# coding: utf-8
from __future__ import unicode_literals
+import re
+
from .common import InfoExtractor
from ..utils import (
int_or_none,
@@ -28,6 +30,12 @@ class VzaarIE(InfoExtractor):
},
}]
+ @staticmethod
+ def _extract_urls(webpage):
+ return re.findall(
+ r'<iframe[^>]+src=["\']((?:https?:)?//(?:view\.vzaar\.com)/[0-9]+)',
+ webpage)
+
def _real_extract(self, url):
video_id = self._match_id(url)
video_data = self._download_json(