Skip to content
Advertisement

Not able to download a file through request in python

When I try to download a file online it doesn’t work for a particular site while it works for others. Why is this happening and what should I do about it?

I write the content of the dl request in my case https://drivers.amd.com/drivers/amd-software-adrenalin-edition-22.11.1-win10-win11-nov15.exe (warning: 500+ MB file) from this page: https://www.amd.com/fr/support/graphics/amd-radeon-6000-series/amd-radeon-6900-series/amd-radeon-rx-6900-xt

JavaScript

Advertisement

Answer

If you read the error page, it tells you exactly what the problem is: they don’t allow downloads without a referer from their website. Therefore, your headers will need to include a Referer key/value, and I assume a proper User-Agent as well:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement