mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-09-08 09:35:01 +00:00
[youtube] Handle incorrectly written cache files (#3549)
This commit is contained in:
parent
db9b0b67b7
commit
55c49908d2
|
@ -374,6 +374,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
|
||||||
return lambda s: u''.join(s[i] for i in cache_spec)
|
return lambda s: u''.join(s[i] for i in cache_spec)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass # No cache available
|
pass # No cache available
|
||||||
|
except ValueError:
|
||||||
|
try:
|
||||||
|
file_size = os.path.getsize(cache_fn)
|
||||||
|
except (OSError, IOError) as oe:
|
||||||
|
file_size = str(oe)
|
||||||
|
self._downloader.report_warning(
|
||||||
|
u'Cache %s failed (%s)' % (cache_fn, file_size))
|
||||||
|
|
||||||
if player_type == 'js':
|
if player_type == 'js':
|
||||||
code = self._download_webpage(
|
code = self._download_webpage(
|
||||||
|
|
Loading…
Reference in a new issue