diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-09-24 21:26:10 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-09-24 21:26:10 +0200 |
commit | 7f747732547fedc876bcdcc77ba53a56324d7e87 (patch) | |
tree | 49c704be54baaf9a9a9a269d8a597023c36358a8 /youtube_dl | |
parent | f2c327fd39d10115573d709f94f20721a80895fb (diff) |
Add option --no-cache-dir
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/__init__.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index ebf4a300f..46d0fbd64 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -167,7 +167,12 @@ def parseOpts(overrideArguments=None): help='Output descriptions of all supported extractors', default=False) general.add_option('--proxy', dest='proxy', default=None, help='Use the specified HTTP/HTTPS proxy', metavar='URL') general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.') - general.add_option('--cache-dir', dest='cachedir', default=u'~/.youtube-dl/cache', help='Location in the filesystem where youtube-dl can store downloaded information permanently. NONE to disable filesystem caching, %default by default') + general.add_option( + '--cache-dir', dest='cachedir', default=u'~/.youtube-dl/cache', + help='Location in the filesystem where youtube-dl can store downloaded information permanently. %default by default') + general.add_option( + '--no-cache-dir', action='store_const', const=None, dest='cachedir', + help='Disable filesystem caching') selection.add_option('--playlist-start', @@ -560,7 +565,7 @@ def _real_main(argv=None): parser.error(u'Cannot download a video and extract audio into the same' u' file! Use "%%(ext)s" instead of %r' % determine_ext(outtmpl, u'')) - + raise ValueError(repr(opts.cachedir)) # YoutubeDL ydl = YoutubeDL({ 'usenetrc': opts.usenetrc, @@ -618,7 +623,7 @@ def _real_main(argv=None): 'min_filesize': opts.min_filesize, 'max_filesize': opts.max_filesize, 'daterange': date, - 'cachedir': opts.cachedir if opts.cachedir != 'NONE' else None, + 'cachedir': opts.cachedir, 'youtube_print_sig_code': opts.youtube_print_sig_code, }) |