A Python module to download any file-type from the internet
pip3 install PyFileDownloader
- Downloading a File
from PyFileDownloader import Downloader
download=Downloader(url="DOWNLOAD LINK")
headers=download.headers()
is_downloadable=download.validate_url()
download.save() .headers()returns you about the file data like filename, filetype, filesize.validate_url()returns True if the provided url is valid.save()downloads the file and saves it with the name provided in the file header
- If you would like to download and save a file with a custom name, you can do so with the
.save()method. It takes afilenameparameter that is set toNoneby default.
from PyFileDownloader import Downloader
download=Downloader(url="DOWNLOAD LINK")
download.save(filename="custom_name.extension") Hope you found this useful!