From cd7624f2cb94ba3c8776b769f294b8a9ad8d7487 Mon Sep 17 00:00:00 2001 From: Jesus E Date: Sun, 18 Jun 2023 19:45:34 -0400 Subject: Set hqdefault thumnail images --- youtube/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'youtube/util.py') diff --git a/youtube/util.py b/youtube/util.py index 6ee9fcd..5e4af55 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -462,7 +462,7 @@ class RateLimitedQueue(gevent.queue.Queue): def download_thumbnail(save_directory, video_id): - url = "https://i.ytimg.com/vi/" + video_id + "/mqdefault.jpg" + url = f"https://i.ytimg.com/vi/{video_id}/hqdefault.jpg" save_location = os.path.join(save_directory, video_id + ".jpg") try: thumbnail = fetch_url(url, report_text="Saved thumbnail: " + video_id) @@ -504,7 +504,7 @@ def video_id(url): # default, sddefault, mqdefault, hqdefault, hq720 def get_thumbnail_url(video_id): - return settings.img_prefix + "https://i.ytimg.com/vi/" + video_id + "/mqdefault.jpg" + return f"{settings.img_prefix}https://i.ytimg.com/vi/{video_id}/hqdefault.jpg" def seconds_to_timestamp(seconds): -- cgit v1.2.3