From 7504cc575a851372e39fd2d66f4e837eee24853d Mon Sep 17 00:00:00 2001 From: Jai Grimshaw Date: Tue, 2 Jun 2015 17:45:38 +1000 Subject: [PATCH] [clickhole] Add extractor --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/clickhole.py | 41 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 youtube_dl/extractor/clickhole.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 67eb96057..2abd039e9 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -72,6 +72,7 @@ from .chirbit import ( ) from .cinchcast import CinchcastIE from .cinemassacre import CinemassacreIE +from .clickhole import ClickholeIE from .clipfish import ClipfishIE from .cliphunter import CliphunterIE from .clipsyndicate import ClipsyndicateIE diff --git a/youtube_dl/extractor/clickhole.py b/youtube_dl/extractor/clickhole.py new file mode 100644 index 000000000..9640b440d --- /dev/null +++ b/youtube_dl/extractor/clickhole.py @@ -0,0 +1,41 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class ClickholeIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?clickhole\.com/video/[a-z\-]+(?P[\d]+)' + _TEST = { + 'url': 'http://www.clickhole.com/video/dont-understand-bitcoin-man-will-mumble-explanatio-2537', + 'md5': '74229b82e3ffde84b6e11dcadcd3d237', + 'info_dict': { + 'id': '2537', + 'ext': 'mp4', + 'title': 'Don’t Understand Bitcoin? This Man Will Mumble An Explanation At You', + 'description': 'Click, watch, share', + 'thumbnail': 're:^https?://.*\.jpg$' + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + # Find the embedded iframe + embedded_url = self._search_regex( + r'