I am trying to download mp3 files, using python, from a website which has Cloud Flare. I know about 'cfscrape' module for python, but how do I use it to get download the file from the url.
I got it.
import cfscrape
scraper = cfscrape.create_scraper()
url = 'the website url'
cfurl = scraper.get(url).content
name = url.split('/')[-1]
with open(name, 'wb') as f:
f.write(cfurl)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With