]> git.bitcoin.ninja Git - youtube-dl/commitdiff
Allow opts.cachedir == None to disable cache
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 24 Sep 2013 19:04:43 +0000 (21:04 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 24 Sep 2013 19:04:43 +0000 (21:04 +0200)
youtube_dl/YoutubeDL.py
youtube_dl/__init__.py
youtube_dl/extractor/youtube.py

index ead1ccb1cf2b911d26dc25175da1c881d331652c..a3a351ee6e8dcecbe81cc7cbb04e2be46bb9d11b 100644 (file)
@@ -82,7 +82,7 @@ class YoutubeDL(object):
     daterange:         A DateRange object, download only if the upload_date is in the range.
     skip_download:     Skip the actual download of the video file
     cachedir:          Location of the cache files in the filesystem.
-                       "NONE" to disable filesystem cache.
+                       None to disable filesystem cache.
     
     The following parameters are not used by YoutubeDL itself, they are used by
     the FileDownloader:
index a4769a8ae173d6e961f2137a237118e685878db7..ebf4a300fb9f0832f40d19db376ced3599841ff9 100644 (file)
@@ -618,7 +618,7 @@ def _real_main(argv=None):
         'min_filesize': opts.min_filesize,
         'max_filesize': opts.max_filesize,
         'daterange': date,
-        'cachedir': opts.cachedir,
+        'cachedir': opts.cachedir if opts.cachedir != 'NONE' else None,
         'youtube_print_sig_code': opts.youtube_print_sig_code,
         })
 
index 049da2f91326b19a1bb1b02be3c1c630535773a3..a6eefdf4ee1521611a0486a861a461a5acb3d763 100644 (file)
@@ -438,7 +438,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
         cache_dir = self._downloader.params.get('cachedir',
                                                 u'~/.youtube-dl/cache')
 
-        cache_enabled = cache_dir != u'NONE'
+        cache_enabled = cache_dir is not None
         if cache_enabled:
             cache_fn = os.path.join(os.path.expanduser(cache_dir),
                                     u'youtube-sigfuncs',