(soup: BeautifulSoup)
| 96 | |
| 97 | |
| 98 | def 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 | # ------------------------------------------------------------------------------------------------ |
no test coverage detected