diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-10-02 08:41:03 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-10-02 08:41:14 +0200 |
commit | c38b1e776dcc525b6fbe0660c484f1d50d2e0165 (patch) | |
tree | b956c4d52962f9d6702ad906c1ff465b8ba52fde /youtube_dl/extractor/youtube.py | |
parent | 4f8bf17f23e2366205d8670fc9af2568063f7e89 (diff) |
[youtube] Simplify cache_dir code (#1529)
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index f3d279210..9ca29a043 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -27,6 +27,7 @@ from ..utils import ( compat_str, clean_html, + get_cachedir, get_element_by_id, ExtractorError, unescapeHTML, @@ -421,12 +422,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): # Read from filesystem cache func_id = '%s_%s_%d' % (player_type, player_id, slen) assert os.path.basename(func_id) == func_id - xdg_cache_home = os.environ.get('XDG_CACHE_HOME') - if xdg_cache_home: - userCacheDir = os.path.join(xdg_cache_home, 'youtube-dl') - else: - userCacheDir = os.path.join(os.path.expanduser('~'), '.cache', 'youtube-dl') - cache_dir = self._downloader.params.get('cachedir', userCacheDir) + cache_dir = get_cachedir(self._downloader.params) cache_enabled = cache_dir is not None if cache_enabled: |