]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/dump.py
[pluralsight] Rephrase
[yt-dlp.git] / youtube_dl / extractor / dump.py
CommitLineData
76beff70
YUK
1# encoding: utf-8
2from __future__ import unicode_literals
3
4import re
5
6from .common import InfoExtractor
91dff032 7
76beff70
YUK
8
9class DumpIE(InfoExtractor):
10 _VALID_URL = r'^https?://(?:www\.)?dump\.com/(?P<id>[a-zA-Z0-9]+)/'
11
83d35817 12 _TEST = {
91dff032
PH
13 'url': 'http://www.dump.com/oneus/',
14 'md5': 'ad71704d1e67dfd9e81e3e8b42d69d99',
15 'info_dict': {
16 'id': 'oneus',
17 'ext': 'flv',
18 'title': "He's one of us.",
19 'thumbnail': 're:^https?://.*\.jpg$',
83d35817
YUK
20 },
21 }
22
76beff70
YUK
23 def _real_extract(self, url):
24 m = re.match(self._VALID_URL, url)
25 video_id = m.group('id')
26
76beff70 27 webpage = self._download_webpage(url, video_id)
91dff032
PH
28 video_url = self._search_regex(
29 r's1.addVariable\("file",\s*"([^"]+)"', webpage, 'video URL')
76beff70 30
fefc9d12
S
31 title = self._og_search_title(webpage)
32 thumbnail = self._og_search_thumbnail(webpage)
76beff70
YUK
33
34 return {
35 'id': video_id,
36 'title': title,
37 'url': video_url,
fefc9d12 38 'thumbnail': thumbnail,
76beff70 39 }