[youtube] Simplify cache_dir code (#1529)
This commit is contained in:
parent
4f8bf17f23
commit
c38b1e776d
3 changed files with 9 additions and 13 deletions
|
@ -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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue