mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
[wgem] handling upper case icon link rel
This commit is contained in:
@@ -81,13 +81,15 @@ class WebApplicationManager(SoftwareManager):
|
|||||||
return name
|
return name
|
||||||
|
|
||||||
def _get_app_icon_url(self, url: str, soup: BeautifulSoup) -> str:
|
def _get_app_icon_url(self, url: str, soup: BeautifulSoup) -> str:
|
||||||
icon_tag = soup.head.find('link', attrs={"rel": "icon"})
|
for rel in ('icon', 'ICON'):
|
||||||
icon_url = icon_tag.get('href') if icon_tag else None
|
icon_tag = soup.head.find('link', attrs={"rel": rel})
|
||||||
|
icon_url = icon_tag.get('href') if icon_tag else None
|
||||||
|
|
||||||
if icon_url and not icon_url.startswith('http'):
|
if icon_url and not icon_url.startswith('http'):
|
||||||
icon_url = url + (icon_url if icon_url.startswith('/') else '/{}'.format(icon_url))
|
icon_url = url + (icon_url if icon_url.startswith('/') else '/{}'.format(icon_url))
|
||||||
|
|
||||||
return icon_url
|
if icon_url:
|
||||||
|
return icon_url
|
||||||
|
|
||||||
def _get_fix_for(self, url_no_protocol: str) -> str:
|
def _get_fix_for(self, url_no_protocol: str) -> str:
|
||||||
res = self.http_client.get(URL_FIX_PATTERN.format(url=url_no_protocol))
|
res = self.http_client.get(URL_FIX_PATTERN.format(url=url_no_protocol))
|
||||||
|
|||||||
Reference in New Issue
Block a user