mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Improve OG meta processing
This commit is contained in:
parent
5348398b23
commit
57fc5ef913
1 changed files with 16 additions and 12 deletions
|
@ -90,6 +90,7 @@ async def external_urls(
|
||||||
if not h:
|
if not h:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
try:
|
||||||
ph = urlparse(h)
|
ph = urlparse(h)
|
||||||
mimetype, _ = mimetypes.guess_type(h)
|
mimetype, _ = mimetypes.guess_type(h)
|
||||||
if (
|
if (
|
||||||
|
@ -102,6 +103,9 @@ async def external_urls(
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
urls.add(h)
|
urls.add(h)
|
||||||
|
except Exception:
|
||||||
|
logger.exception(f"Failed to check {h}")
|
||||||
|
continue
|
||||||
|
|
||||||
return urls - tags_hrefs
|
return urls - tags_hrefs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue