'WGET Python 3.6 getting stuck

I'm trying to download almost a thousand files from a website. Each of the files has its own URL.

I'm looping the following command while changing the url and the name of the downloaded file as newfile:

wget.download(url, newfile)

The download of each file starts with a .tmp file whose size keeps increasing until the entire file is downloaded. However, after downloading 5-10 files in about 10 min, the program just simply stops with the .tmp file "stuck" at the same size!

When I kill the process, delete the .tmp file and resume the program, it runs smoothly but then again stops exactly the same way 5-10 files later!

I'm using python 3.6.9



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source