diff --git a/django_code/stash_management/apps.py b/django_code/stash_management/apps.py index b0dc472..ffbaf9c 100644 --- a/django_code/stash_management/apps.py +++ b/django_code/stash_management/apps.py @@ -28,6 +28,11 @@ proxy = urlrequest.ProxyHandler({ 'https': proxy_url # Add the handler for HTTPS }) +proxies = { + "http" : proxy_url, + "https" : proxy_url + } + destination_folder = "/tmp/stash" def hello(request): @@ -55,7 +60,8 @@ def album_downloader(name,url,external_galleries): req = urlrequest.Request(url) urlcurl = urlrequest.urlopen(req).read() - page = requests.get(url) + + page = requests.get(url,proxies=proxies) webpage = html.fromstring(page.content) #get all URLs from the code source (searching for href tag on the code)