MCPcopy Create free account
hub / github.com/clockworknowledge/menome_processor / extract_thumbnail

Function extract_thumbnail

app/routers/document.py:98–104  ·  view source on GitHub ↗
(soup: BeautifulSoup)

Source from the content-addressed store, hash-verified

96
97
98def extract_thumbnail(soup: BeautifulSoup) -> str:
99 thumb = soup.find('meta', attrs={'name': 'thumbnail'})
100
101 if thumb:
102 return thumb.get('content', '')
103 # If no thumbnail meta tag is found, try fetching the primary image as a fallback
104 return extract_primary_image(soup)
105
106
107# ------------------------------------------------------------------------------------------------

Callers 1

add_documentFunction · 0.85

Calls 1

extract_primary_imageFunction · 0.85

Tested by

no test coverage detected