From ccfa7671b0bbda600c468cf7e6b833042de23f74 Mon Sep 17 00:00:00 2001 From: John D Date: Sun, 15 Oct 2017 22:26:12 -0700 Subject: [PATCH] [vidlii] add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/vidlii.py | 35 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 youtube_dl/extractor/vidlii.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index ecb33bc9e..d2af67610 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1192,6 +1192,7 @@ from .videomore import ( from .videopremium import VideoPremiumIE from .videopress import VideoPressIE from .vidio import VidioIE +from .vidlii import VidliiIE from .vidme import ( VidmeIE, VidmeUserIE, diff --git a/youtube_dl/extractor/vidlii.py b/youtube_dl/extractor/vidlii.py new file mode 100644 index 000000000..fa0cc7441 --- /dev/null +++ b/youtube_dl/extractor/vidlii.py @@ -0,0 +1,35 @@ +# coding: utf-8 +from __future__ import unicode_literals +from .common import InfoExtractor +from ..utils import int_or_none + + +class VidliiIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?vidlii\.com/watch\?v\=(?P[a-zA-Z0-9]+$)' + _TEST = { + 'url': 'https://www.vidlii.com/watch?v=vBo2IcrwOkO', + 'md5': 'b42640a596b4dc986702567d49268963', + 'info_dict': { + 'id': 'vBo2IcrwOkO', + 'ext': 'mp4', + 'title': '(OLD VIDEO) i like youtube!!', + + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + video_url = self._search_regex(r'var videoInfo\s+=\s+{\s+src\:\s+"(.+?)"', webpage, 'video URL') + title = self._html_search_regex(r'

(.+?)

', webpage, 'title') + view_count = int_or_none(self._html_search_regex(r']+class="w_views"[^>]*>(\d*)', webpage, 'views')) + + return { + 'id': video_id, + 'title': title, + 'view_count': view_count, + 'formats': [{ + 'url': video_url, + }], + + }