add proxy on requests module
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4m15s

This commit is contained in:
Pierre Geeraert
2025-12-03 12:41:50 +00:00
parent b227337ced
commit 924d3dabb9
+7 -1
View File
@@ -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)