[KeezMovies] Applied third requested fixes for PR #16154

This commit is contained in:
Parmjit Virk 2018-04-17 14:47:26 -05:00
parent 9e61f0e191
commit 7e8ca819c3
2 changed files with 10 additions and 9 deletions

View File

@ -1078,14 +1078,9 @@ class InfoExtractor(object):
html, '%s form' % form_id, group='form')
return self._hidden_inputs(form)
def _sort_formats(self, formats, field_preference=None, fatal=True):
def _sort_formats(self, formats, field_preference=None):
if not formats:
msg = 'No video formats found'
if fatal:
raise ExtractorError(msg)
else:
self._downloader.report_warning(msg)
return None
raise ExtractorError('No video formats found')
for f in formats:
# Automatically determine tbr when missing based on abr and vbr (improves

View File

@ -36,7 +36,7 @@ class KeezMoviesIE(InfoExtractor):
'only_matching': True,
}]
def _extract_info(self, url):
def _extract_info(self, url, fatal=True):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
display_id = (mobj.group('display_id')
@ -105,7 +105,13 @@ class KeezMoviesIE(InfoExtractor):
raise ExtractorError(
'Video %s is no longer available' % video_id, expected=True)
self._sort_formats(formats, fatal=False)
try:
self._sort_formats(formats)
except ExtractorError as e:
if fatal:
raise ExtractorError(e, expected=True)
else:
self._downloader.report_warning(e)
if not title:
title = self._html_search_regex(