From a0163ce899c20085b2382bc385cdcb88c2199a16 Mon Sep 17 00:00:00 2001 From: devnomnom Date: Sat, 20 Jun 2015 07:17:57 -0400 Subject: [PATCH] [xvx] Add new extractor --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/xvx.py | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 youtube_dl/extractor/xvx.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 6c548d8e9..330629ed7 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -704,6 +704,7 @@ from .xstream import XstreamIE from .xtube import XTubeUserIE, XTubeIE from .xuite import XuiteIE from .xvideos import XVideosIE +from .xvx import XVXIE from .xxxymovies import XXXYMoviesIE from .yahoo import ( YahooIE, diff --git a/youtube_dl/extractor/xvx.py b/youtube_dl/extractor/xvx.py new file mode 100644 index 000000000..dc3322776 --- /dev/null +++ b/youtube_dl/extractor/xvx.py @@ -0,0 +1,40 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..compat import ( + compat_urllib_request, + compat_urlparse +) + +class XVXIE(InfoExtractor): + _VALID_URL =r'(?:https?://)?(?:www\.)?xvx\.so/view/(?P\d+)' + _TEST = { + 'url': 'http://xvx.so/view/205728768', + 'md5': '1befd4eff6bb71b1abbafbfa46333153', + 'info_dict': { + 'id': '205728768', + 'ext': 'flv', + 'title': 'Brazzers - Undersecretary', + 'age_limit': 18 + } + } + + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + + video_id = mobj.group('id') + + webpage = self._download_webpage(url, video_id) + + video_title = self._html_search_regex(r'\s*(.*) watch online for free | xvx.so', webpage, 'title') + video_url = self._search_regex(r'video_url=(.+?)&', webpage, 'video url') + + return { + 'id': video_id, + 'url': video_url, + 'title': video_title, + 'age_limit': 18 + }