Update app.py
Browse files
app.py
CHANGED
@@ -231,7 +231,11 @@ def download_pdf(url, output_path):
|
|
231 |
return True
|
232 |
except requests.exceptions.RequestException as e:
|
233 |
logger.error(f"Failed to download {url}: {e}")
|
234 |
-
if os.path.exists(output_path):
|
|
|
|
|
|
|
|
|
235 |
return False
|
236 |
except Exception as e:
|
237 |
logger.error(f"An unexpected error occurred during download of {url}: {e}")
|
|
|
231 |
return True
|
232 |
except requests.exceptions.RequestException as e:
|
233 |
logger.error(f"Failed to download {url}: {e}")
|
234 |
+
if os.path.exists(output_path):
|
235 |
+
try:
|
236 |
+
os.remove(output_path)
|
237 |
+
except:
|
238 |
+
pass
|
239 |
return False
|
240 |
except Exception as e:
|
241 |
logger.error(f"An unexpected error occurred during download of {url}: {e}")
|