aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/watch.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/watch.py')
-rw-r--r--youtube/watch.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/youtube/watch.py b/youtube/watch.py
index 360fbc9..332a9d5 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -329,11 +329,8 @@ def get_ordered_music_list_attributes(music_list):
def save_decrypt_cache():
- try:
- f = open(os.path.join(settings.data_dir, 'decrypt_function_cache.json'), 'w')
- except FileNotFoundError:
- os.makedirs(settings.data_dir)
- f = open(os.path.join(settings.data_dir, 'decrypt_function_cache.json'), 'w')
+ os.makedirs(settings.data_dir, exist_ok=True)
+ f = open(os.path.join(settings.data_dir, 'decrypt_function_cache.json'), 'w')
f.write(json.dumps({'version': 1, 'decrypt_cache':decrypt_cache}, indent=4, sort_keys=True))
f.close()