diff --git a/instaloader/lateststamps.py b/instaloader/lateststamps.py index 9a67cc2..5846948 100644 --- a/instaloader/lateststamps.py +++ b/instaloader/lateststamps.py @@ -1,6 +1,8 @@ import configparser from datetime import datetime, timezone from typing import Optional +from os.path import dirname +from os import makedirs class LatestStamps: @@ -25,6 +27,7 @@ class LatestStamps: self.data.read(latest_stamps_file) def _save(self): + makedirs(dirname(self.file), exist_ok=True) with open(self.file, 'w') as f: self.data.write(f)