mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-13 23:02:34 +00:00
parent
3616300155
commit
b25d6cb963
2 changed files with 3 additions and 7 deletions
|
@ -39,11 +39,7 @@ class Cache:
|
|||
|
||||
fn = self._get_cache_fn(section, key, dtype)
|
||||
try:
|
||||
try:
|
||||
os.makedirs(os.path.dirname(fn))
|
||||
except OSError as ose:
|
||||
if ose.errno != errno.EEXIST:
|
||||
raise
|
||||
os.makedirs(os.path.dirname(fn), exist_ok=True)
|
||||
self._ydl.write_debug(f'Saving {section}.{key} to cache')
|
||||
write_json_file({'yt-dlp_version': __version__, 'data': data}, fn)
|
||||
except Exception:
|
||||
|
|
|
@ -5370,8 +5370,8 @@ def random_uuidv4():
|
|||
def make_dir(path, to_screen=None):
|
||||
try:
|
||||
dn = os.path.dirname(path)
|
||||
if dn and not os.path.exists(dn):
|
||||
os.makedirs(dn)
|
||||
if dn:
|
||||
os.makedirs(dn, exist_ok=True)
|
||||
return True
|
||||
except OSError as err:
|
||||
if callable(to_screen) is not None:
|
||||
|
|
Loading…
Reference in a new issue