commit c481871bdef0e485633b67787f446239a46b1ffe
parent 1dfd002e53775cfcfef7bf2cdffdfb9087516244
Author: Claude Heiland-Allen <claude@mathr.co.uk>
Date: Thu Jun 15 07:46:51 +0100
simplify directory creation
Signed-off-by: ugrnm <ultrageranium@bleu255.com>
Diffstat:1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/download_loooooops.py b/download_loooooops.py
@@ -101,13 +101,9 @@ for collection in data:
i["account"]["username"],
len(i["media_attachments"])))
-if not os.path.exists(output_dir):
- os.mkdir(output_dir)
-
for l in looooops:
path = os.path.join(output_dir,"{}_{}".format(l['creator'], l['id']))
- if not os.path.exists(path):
- os.mkdir(path)
+ os.makedirs(path, exist_ok=True)
print("\n")
print("Downloading looops by ***{}***".format(l['creator']))