aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-09-22 10:50:12 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2013-09-22 10:51:33 +0200
commitf8061589e66f12f6c2ffac3d7bfba2a7ac0294d5 (patch)
treea07fc9e33e4b619c3c2e97be4e3b15e9b65736dc /youtube_dl/extractor
parent0ca96d48c7f74e122be70b71bb5fe38f4b143cb0 (diff)
[youtube] Actually pass in cachedir option
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/youtube.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index a9bfc455f..2dd2db673 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -438,7 +438,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
cache_dir = self._downloader.params.get('cachedir',
u'~/.youtube-dl/cache')
- if cache_dir != u'NONE':
+ cache_enabled = cache_dir != u'NONE'
+ if cache_enabled:
cache_fn = os.path.join(os.path.expanduser(cache_dir),
u'youtube-sigfuncs',
func_id + '.json')
@@ -465,7 +466,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
else:
assert False, 'Invalid player type %r' % player_type
- if cache_dir is not False:
+ if cache_enabled:
try:
cache_res = res(map(compat_chr, range(slen)))
cache_spec = [ord(c) for c in cache_res]
@@ -515,7 +516,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
cache_spec = [ord(c) for c in cache_res]
expr_code = u' + '.join(gen_sig_code(cache_spec))
code = u'if len(s) == %d:\n return %s\n' % (slen, expr_code)
- self.to_screen(u'Extracted signature:\n' + code)
+ self.to_screen(u'Extracted signature function:\n' + code)
def _parse_sig_js(self, jscode):
funcname = self._search_regex(