✨️ create tmp folder if it does not exist
This commit is contained in:
parent
12446bb04f
commit
1297e0376b
|
|
@ -41,6 +41,13 @@ class TazDownloader:
|
||||||
Downloads a newspaper from dl.taz.de and stores it in /tmp
|
Downloads a newspaper from dl.taz.de and stores it in /tmp
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Check if folder exists
|
||||||
|
try:
|
||||||
|
if not os.path.isdir(dir_path):
|
||||||
|
os.mkdirs(dir_path)
|
||||||
|
except Exception as e:
|
||||||
|
raise TazDownloadError(f"Could find or create \"{dir_path}\":\n{e}")
|
||||||
|
|
||||||
# download taz
|
# download taz
|
||||||
try:
|
try:
|
||||||
with requests.get(
|
with requests.get(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue