diff --git a/youtube_dl/extractor/imgur.py b/youtube_dl/extractor/imgur.py index 38c9617731..7937a5c819 100644 --- a/youtube_dl/extractor/imgur.py +++ b/youtube_dl/extractor/imgur.py @@ -5,6 +5,7 @@ import re from .common import InfoExtractor from ..utils import ( int_or_none, + str_or_none, js_to_json, mimetype2ext, ExtractorError, @@ -35,11 +36,6 @@ class ImgurIE(InfoExtractor): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - sources = re.findall(r'(.*?)', - webpage, 'video elements') + webpage, 'video elements', fatal=False)) + if not video_elements: + raise ExtractorError( + 'No sources found for video %s' % video_id, expected=True) + formats = [] for m in re.finditer(r'[^"]+)"\s+type="(?P[^"]+)"', video_elements): formats.append({