]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/wimp.py
Start moving to ytdl-org
[yt-dlp.git] / youtube_dl / extractor / wimp.py
CommitLineData
2250865f
PH
1from __future__ import unicode_literals
2
a4a554a7 3from .common import InfoExtractor
983af260 4from .youtube import YoutubeIE
405ec05c
YK
5
6
a4a554a7 7class WimpIE(InfoExtractor):
5886b38d 8 _VALID_URL = r'https?://(?:www\.)?wimp\.com/(?P<id>[^/]+)'
983af260 9 _TESTS = [{
efbd1eb5 10 'url': 'http://www.wimp.com/maru-is-exhausted/',
b1b7d1ff 11 'md5': 'ee21217ffd66d058e8b16be340b74883',
2250865f 12 'info_dict': {
efbd1eb5 13 'id': 'maru-is-exhausted',
b1b7d1ff 14 'ext': 'mp4',
da362979
S
15 'title': 'Maru is exhausted.',
16 'description': 'md5:57e099e857c0a4ea312542b684a869b8',
6f5ac90c 17 }
983af260 18 }, {
983af260 19 'url': 'http://www.wimp.com/clowncar/',
efbd1eb5 20 'md5': '5c31ad862a90dc5b1f023956faec13fe',
983af260 21 'info_dict': {
efbd1eb5 22 'id': 'cG4CEr2aiSg',
f22ba4bd 23 'ext': 'webm',
efbd1eb5
YCH
24 'title': 'Basset hound clown car...incredible!',
25 'description': '5 of my Bassets crawled in this dog loo! www.bellinghambassets.com\n\nFor licensing/usage please contact: licensing(at)jukinmediadotcom',
26 'upload_date': '20140303',
27 'uploader': 'Gretchen Hoey',
28 'uploader_id': 'gretchenandjeff1',
983af260 29 },
efbd1eb5 30 'add_ie': ['Youtube'],
983af260 31 }]
405ec05c
YK
32
33 def _real_extract(self, url):
b1b7d1ff 34 video_id = self._match_id(url)
0d2d967c 35
405ec05c 36 webpage = self._download_webpage(url, video_id)
0d2d967c
S
37
38 youtube_id = self._search_regex(
d253df2f
S
39 (r"videoId\s*:\s*[\"']([0-9A-Za-z_-]{11})[\"']",
40 r'data-id=["\']([0-9A-Za-z_-]{11})'),
0d2d967c
S
41 webpage, 'video URL', default=None)
42 if youtube_id:
d226c560 43 return self.url_result(youtube_id, YoutubeIE.ie_key())
5abeaf06 44
efbd1eb5
YCH
45 info_dict = self._extract_jwplayer_data(
46 webpage, video_id, require_title=False)
0d2d967c 47
efbd1eb5 48 info_dict.update({
11bf8481 49 'id': video_id,
11bf8481 50 'title': self._og_search_title(webpage),
11bf8481 51 'description': self._og_search_description(webpage),
efbd1eb5
YCH
52 })
53
54 return info_dict