projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db9b0b6
)
[youtube] Handle incorrectly written cache files (#3549)
author
Philipp Hagemeister
<phihag@phihag.de>
Thu, 21 Aug 2014 10:15:51 +0000
(12:15 +0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Thu, 21 Aug 2014 10:15:51 +0000
(12:15 +0200)
youtube_dl/extractor/youtube.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index 3c9b0b58402189338b5480d1d20f589b751e6dfe..8b520e0f039cb62fbaa817de7938cab9e99dc63b 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-374,6
+374,13
@@
class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
return lambda s: u''.join(s[i] for i in cache_spec)
except IOError:
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':
code = self._download_webpage(