Write failed downloads to file
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user