From a7bd929255134c4846fd2cbc0148bcc8aa329a6f Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Mon, 2 May 2016 19:55:34 +0200 Subject: [PATCH] [thevideobee.to] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/thevideobee.py | 61 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 youtube_dl/extractor/thevideobee.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index ef4431364..479e8203f 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -755,6 +755,7 @@ from .theplatform import ( from .thescene import TheSceneIE from .thesixtyone import TheSixtyOneIE from .thestar import TheStarIE +from .thevideobee import TheVideoBeeIE from .thisamericanlife import ThisAmericanLifeIE from .thisav import ThisAVIE from .tinypic import TinyPicIE diff --git a/youtube_dl/extractor/thevideobee.py b/youtube_dl/extractor/thevideobee.py new file mode 100644 index 000000000..d10f9e465 --- /dev/null +++ b/youtube_dl/extractor/thevideobee.py @@ -0,0 +1,61 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..utils import ( + sanitized_Request, + urlencode_postdata, +) + + +class TheVideoBeeIE(InfoExtractor): + IE_NAME = 'thevideobee.to' + _VALID_URL = r'https?:\/\/(www\.)?thevideobee\.to\/(?P[a-zA-Z0-9-]+)(\.html)?' + _TEST = { + 'url': 'http://thevideobee.to/wuqosqufmqv3', + 'md5': 'ffa2f1484d99548226876554ec808f00', + 'info_dict': { + 'id': 'wuqosqufmqv3', + 'ext': 'mp4', + 'title': 'Most Crazy Complex Pranks', + 'thumbnail': 'http://fsc.thevideobee.to/i/01/00000/wuqosqufmqv3.jpg' + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + url = 'http://thevideobee.to/%s' % video_id + + orig_webpage = self._download_webpage(url, video_id) + + fields = re.findall( + r'''(?x)([^<]+)<\/h1>', webpage, 'title') + video_url = self._search_regex(r'file:\s*"([^"]+\.mp4)', webpage, 'video URL') + thumbnail = self._search_regex(r'image:\s*"(.*?)"', webpage, 'thumbnail URL', fatal=False) + + return { + 'id': video_id, + 'url': video_url, + 'title': title, + 'thumbnail': thumbnail + }