From c481871bdef0e485633b67787f446239a46b1ffe Mon Sep 17 00:00:00 2001 From: Claude Heiland-Allen Date: Thu, 15 Jun 2023 07:46:51 +0100 Subject: [PATCH] simplify directory creation Signed-off-by: ugrnm --- download_loooooops.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/download_loooooops.py b/download_loooooops.py index 6a6d79d..71ecc77 100755 --- 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']))