X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fdump.py;h=6b651778afa2faa57237314cde7a25f3ebb06278;hb=d156a1d981b2773e1c35c9eb7d9b9a3bbcea7c96;hp=cfa71bd38d9809cebc429f9197017b93e80682cd;hpb=76beff70a8899651b40a664a63ed2e4586145328;p=youtube-dl diff --git a/youtube_dl/extractor/dump.py b/youtube_dl/extractor/dump.py index cfa71bd38..6b651778a 100644 --- a/youtube_dl/extractor/dump.py +++ b/youtube_dl/extractor/dump.py @@ -4,36 +4,36 @@ from __future__ import unicode_literals import re from .common import InfoExtractor -from ..utils import ( - ExtractorError, -) + class DumpIE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?dump\.com/(?P[a-zA-Z0-9]+)/' + _TEST = { + 'url': 'http://www.dump.com/oneus/', + 'md5': 'ad71704d1e67dfd9e81e3e8b42d69d99', + 'info_dict': { + 'id': 'oneus', + 'ext': 'flv', + 'title': "He's one of us.", + 'thumbnail': 're:^https?://.*\.jpg$', + }, + } + def _real_extract(self, url): m = re.match(self._VALID_URL, url) video_id = m.group('id') - # Note: There is an easier-to-parse configuration at - # http://www.aparat.com/video/video/config/videohash/%video_id - # but the URL in there does not work - webpage = self._download_webpage(url, video_id) + video_url = self._search_regex( + r's1.addVariable\("file",\s*"([^"]+)"', webpage, 'video URL') - try: - video_url = re.findall(r'file","(.+?.flv)"', webpage)[-1] - except IndexError: - raise ExtractorError(u'No video URL found') - - thumb = re.findall('([^"]+)', webpage, u'title') + thumb = self._og_search_thumbnail(webpage) + title = self._search_regex(r'([^"]+)', webpage, 'title') return { 'id': video_id, 'title': title, 'url': video_url, - 'ext': 'flv', 'thumbnail': thumb, }