Reddit_Downloader
·106 words·1 min
Reddit_Downloader #
Get page #
Because Reddit requires authentication, it’s easier to go to the website and get the page source to parse the image urls
Config #
element = "classname or elecment id"
filename = "example.txt"
directory = "example"
Running #
# Get filename and directory from config
FILENAME = config.filename
DIRECTORY = config.directory
# Make GetUrls object and give it filename
geturls = GetUrls(FILENAME)
# Parse and Extract urls
geturls.parse_urls()
geturls.extract_url()
# Gets urls list and give to download obejct
urls = geturls.image_urls
# Setup directory
_setup = Setup(DIRECTORY)
_setup.setup()
# Make download object and download list of urls
_dowload = DownloadUrls(urls, DIRECTORY)
_dowload.download()