[KeezMovies] Applied third requested fixes for PR #16154
This commit is contained in:
parent
9e61f0e191
commit
7e8ca819c3
@ -1078,14 +1078,9 @@ class InfoExtractor(object):
|
|||||||
html, '%s form' % form_id, group='form')
|
html, '%s form' % form_id, group='form')
|
||||||
return self._hidden_inputs(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:
|
if not formats:
|
||||||
msg = 'No video formats found'
|
raise ExtractorError('No video formats found')
|
||||||
if fatal:
|
|
||||||
raise ExtractorError(msg)
|
|
||||||
else:
|
|
||||||
self._downloader.report_warning(msg)
|
|
||||||
return None
|
|
||||||
|
|
||||||
for f in formats:
|
for f in formats:
|
||||||
# Automatically determine tbr when missing based on abr and vbr (improves
|
# Automatically determine tbr when missing based on abr and vbr (improves
|
||||||
|
@ -36,7 +36,7 @@ class KeezMoviesIE(InfoExtractor):
|
|||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _extract_info(self, url):
|
def _extract_info(self, url, fatal=True):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
video_id = mobj.group('id')
|
video_id = mobj.group('id')
|
||||||
display_id = (mobj.group('display_id')
|
display_id = (mobj.group('display_id')
|
||||||
@ -105,7 +105,13 @@ class KeezMoviesIE(InfoExtractor):
|
|||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'Video %s is no longer available' % video_id, expected=True)
|
'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:
|
if not title:
|
||||||
title = self._html_search_regex(
|
title = self._html_search_regex(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user