'min_filesize': opts.min_filesize,
'max_filesize': opts.max_filesize,
'daterange': date,
- 'youtube_print_sig_code': opts.youtube_print_sig_code
+ 'cachedir': opts.cachedir,
+ 'youtube_print_sig_code': opts.youtube_print_sig_code,
})
if opts.verbose:
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')
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]
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(