X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Futils.py;h=f5f9cde99b0c65363a098923e4c350182896f7f1;hb=c38b1e776dcc525b6fbe0660c484f1d50d2e0165;hp=201ed255dfacca6853f1388e5ad05b613eca4fb5;hpb=4f8bf17f23e2366205d8670fc9af2568063f7e89;p=youtube-dl diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 201ed255d..f5f9cde99 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -824,3 +824,9 @@ def intlist_to_bytes(xs): return ''.join([chr(x) for x in xs]) else: return bytes(xs) + + +def get_cachedir(params={}): + cache_root = os.environ.get('XDG_CACHE_HOME', + os.path.expanduser('~/.cache')) + return params.get('cachedir', os.path.join(cache_root, 'youtube-dl'))