fix: source thumbnails dropped for http-only og:image URLs (#667)

* fix: accept http (not just https) og:image URLs for source thumbnails

* test: og:image extraction accepts http and skips relative/svg
This commit is contained in:
Afonso Coutinho
2026-06-02 03:41:33 +01:00
committed by GitHub
parent c303a29670
commit 9d8eebfa63
2 changed files with 34 additions and 2 deletions

View File

@@ -130,9 +130,9 @@ def _extract_og_image(soup: BeautifulSoup) -> str:
tag = soup.find("meta", attrs={"name": "thumbnail"})
if tag and tag.get("content", "").strip():
candidates.append(tag["content"].strip())
# Return first absolute https URL
# Return first absolute http(s) URL
for url in candidates:
if url.startswith("https://") and not url.endswith((".svg", ".ico")):
if url.startswith(("https://", "http://")) and not url.endswith((".svg", ".ico")):
return url
return ""