we are now able locally to get all albums and go through all of them and get the images links
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m19s

This commit is contained in:
pierre geeraert
2025-12-02 22:41:52 +00:00
parent 31e72f28b0
commit 789fc8bcbc
+17 -4
View File
@@ -16,7 +16,6 @@ import mimetypes
import ruamel.yaml import ruamel.yaml
import yaml import yaml
from urllib import request as urlrequest from urllib import request as urlrequest
from urllib import parse as urlparse
proxy_url = 'http://gluetun-svc.gluetun.svc:8888' proxy_url = 'http://gluetun-svc.gluetun.svc:8888'
proxy = urlrequest.ProxyHandler({ proxy = urlrequest.ProxyHandler({
@@ -49,10 +48,24 @@ def album_downloader(name,url,external_galleries):
urlcurl = urlrequest.urlopen(req).read() urlcurl = urlrequest.urlopen(req).read()
page = requests.get(url) page = requests.get(url)
webpage = html.fromstring(page.content) webpage = html.fromstring(page.content)
#get all URLs from the code source (searching for href tag on the code)
#https://stackoverflow.com/questions/21455349/xpath-query-get-attribute-href-from-a-tag
webpage_all_url = webpage.xpath('//a/@href')
#search for the href that contains the galleries
webpage_all_album_url = webpage.xpath("//a[contains(@href,'pornpics.com/galleries/')]/@href")
#print(webpage_all_album_url[3])
#print(webpage_all_album_url)
print(webpage.xpath('//a/@href'))
#grep "https://www.pornpics.com/galleries/" for album in webpage_all_album_url:
print("Album "+album)
print("")
page = requests.get(album)
webpage = html.fromstring(page.content)
print(webpage.xpath("//a[contains(@href,'cdni.pornpics.com/1280/')]/@href"))
return 0 return 0