restoU fix

This commit is contained in:
Brieuc Dubois 2024-04-19 12:20:32 +02:00
parent eed1b36d3e
commit 4031d611bb
3 changed files with 17 additions and 5 deletions

View File

@ -18,9 +18,16 @@ async def extract_picture_url(url, base_url):
images = soup.find_all('img')
for img in images:
src = img.get('src')
if src and src.startswith(base_url):
for a in soup.find_all('a'):
href = a.get('href')
if not href or not href.startswith(base_url):
continue
for img in a.find_all('img'):
src = img.get('src')
if not src or not src.startswith(base_url):
continue
if src.startswith('//'):
return f"https:{src}"
else:
@ -59,7 +66,7 @@ class UCLouvainRestoUBot(Plugin):
data = await download_image(
await extract_picture_url(
"https://uclouvain.be/fr/decouvrir/resto-u/le-galilee-self.html",
"//cdn.uclouvain.be/groups/cms-editors-resto-u/menu"
"//cdn.uclouvain.be/groups/cms-editors-resto-u/"
)
)
url = await self.client.upload_media(data, mime_type="application/json")

@ -1 +1 @@
Subproject commit a2eff3236238fd1d0be818b81a0b05854761b02d
Subproject commit e618a7fb0d38939c4556d9da55bfe268b7f80dc4

View File

@ -87,3 +87,8 @@ sections:
url: https://uclouvain.atlassian.net/jira/dashboards/10025
statusCheck: false
id: 5_1631_jira
- title: Gestion accès externes
url: >-
https://sites.uclouvain.be/sgsi-apps/shib-accesressources/prod/index.php
statusCheck: false
id: 6_1631_gestionaccsexternes