Write failed downloads to file

This commit is contained in:
iamdoubz
2026-03-25 09:56:08 -05:00
parent e2ec03c354
commit 51a1921b12
+7
View File
@@ -263,6 +263,13 @@ def main():
ttmin, ttmsec = divmod(total_time, 60)
tavg_speed = round((total_size/total_time/1024/1024)*8, 1)
logging.info(f"Downloaded {round((total_size/1024/1024), 2)}MB in {int(ttmin)}m {int(ttmsec)}s ({tavg_speed} Mbps).")
if failed_urls:
# Add URL links to a file
fn = f"failed_downloads.txt"
fnt = 'a'
with open(f"{fn}", fnt) as f:
for item in failed_urls:
f.write(item + '\n')
if __name__ == "__main__":
main()