Skip to content

Commit

Permalink
better thumbs for yt
Browse files Browse the repository at this point in the history
  • Loading branch information
sb0y committed Oct 16, 2024
1 parent 8fdfde6 commit f958b6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions warp_beacon/scraper/youtube/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def download_thumbnail(self, url: str, timeout: int) -> Optional[io.BytesIO]:
logging.info("Youtube thumbnail url '%s'", url)
with urllib.request.urlopen(url, timeout=timeout) as f:
image = Image.open(io.BytesIO(f.read()))
image = MediaInfoAbstract.shrink_image_to_fit(image)
image = MediaInfoAbstract.shrink_image_to_fit(image, size=(320, 240))
io_buf = io.BytesIO()
image.save(io_buf, format='JPEG', subsampling=0, quality=100)
image.save(io_buf, format='JPEG', subsampling=0, quality=100, progressive=True, optimize=False, icc_profile=image.info.get('icc_profile'))
io_buf.seek(0)
return io_buf
except Exception as e:
Expand Down

0 comments on commit f958b6e

Please sign in to comment.