import requests url = "url of the file" response = requests.get(url, allow_redirects=True) with open('filename', 'wb') as file: file.write(response.content) file.close()