|
|
|
@ -760,10 +760,12 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|
|
|
|
note='%s%s' % (note, ' (retry #%d)' % count if count else ''))
|
|
|
|
|
except ExtractorError as e:
|
|
|
|
|
if isinstance(e.cause, network_exceptions):
|
|
|
|
|
if isinstance(e.cause, compat_HTTPError) and not is_html(e.cause.read(512)):
|
|
|
|
|
e.cause.seek(0)
|
|
|
|
|
if isinstance(e.cause, compat_HTTPError):
|
|
|
|
|
first_bytes = e.cause.read(512)
|
|
|
|
|
if not is_html(first_bytes):
|
|
|
|
|
yt_error = try_get(
|
|
|
|
|
self._parse_json(e.cause.read().decode(), item_id, fatal=False),
|
|
|
|
|
self._parse_json(
|
|
|
|
|
self._webpage_read_content(e.cause, None, item_id, prefix=first_bytes) or '{}', item_id, fatal=False),
|
|
|
|
|
lambda x: x['error']['message'], compat_str)
|
|
|
|
|
if yt_error:
|
|
|
|
|
self._report_alerts([('ERROR', yt_error)], fatal=False)
|
|
|
|
|