X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/a4f82408d9a3d921d9c2af7e4d757f44737dc7ea..46113edab215c2211a604c06245c16d5d4e57dcf:/youtube_dl/extractor/quickvid.py diff --git a/youtube_dl/extractor/quickvid.py b/youtube_dl/extractor/quickvid.py new file mode 100644 index 0000000..3bc7806 --- /dev/null +++ b/youtube_dl/extractor/quickvid.py @@ -0,0 +1,51 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..utils import ( + compat_urlparse, + determine_ext, + int_or_none, +) + + +class QuickVidIE(InfoExtractor): + _VALID_URL = r'https?://(www\.)?quickvid\.org/watch\.php\?v=(?P[a-zA-Z_0-9-]+)' + _TEST = { + 'url': 'http://quickvid.org/watch.php?v=sUQT3RCG8dx', + 'md5': 'c0c72dd473f260c06c808a05d19acdc5', + 'info_dict': { + 'id': 'sUQT3RCG8dx', + 'ext': 'mp4', + 'title': 'Nick Offerman\'s Summer Reading Recap', + 'thumbnail': 're:^https?://.*\.(?:png|jpg|gif)$', + 'view_count': int, + }, + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + title = self._html_search_regex(r'

(.*?)

', webpage, 'title') + view_count = int_or_none(self._html_search_regex( + r'(?s)
(.*?)
', + webpage, 'view count', fatal=False)) + video_code = self._search_regex( + r'(?s)', webpage, 'video code') + formats = [ + { + 'url': compat_urlparse.urljoin(url, src), + 'format_id': determine_ext(src, None), + } for src in re.findall('