1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-26 04:32:51 +01:00

create missing directories for archive files (#2597)

This commit is contained in:
Mike Fährmann 2022-05-17 12:57:01 +02:00
parent 82c1cc130b
commit a96f9d29b5
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -695,7 +695,11 @@ class ExtendedUrl():
class DownloadArchive():
def __init__(self, path, format_string, cache_key="_archive_key"):
con = sqlite3.connect(path, timeout=60, check_same_thread=False)
try:
con = sqlite3.connect(path, timeout=60, check_same_thread=False)
except sqlite3.OperationalError:
os.makedirs(os.path.dirname(path))
con = sqlite3.connect(path, timeout=60, check_same_thread=False)
con.isolation_level = None
self.close = con.close