From f07f2ce32d92e5c91f385f2180e301fb023e35df Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 9 Oct 2025 19:17:11 +0200 Subject: [PATCH 1/2] Removed underscore from VIDEO_FORMATS --- py34/url.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py34/url.py b/py34/url.py index 2dbe42b..e3d93e7 100644 --- a/py34/url.py +++ b/py34/url.py @@ -3,7 +3,7 @@ from os.path import splitext IMAGE_FORMATS = ["jpeg", "jpg", "png", "gif", "mp4", "webm"] -_VIDEO_FORMATS = ["mp4", "webm"] +VIDEO_FORMATS = ["mp4", "webm"] class ViewURL: From a4e3ced8ab49a720911a1d098f51bda5a4b1e6a8 Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 9 Oct 2025 19:18:26 +0200 Subject: [PATCH 2/2] Download videos too, prioritize video over image --- scraper/block.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scraper/block.py b/scraper/block.py index 8021764..8a45d2f 100644 --- a/scraper/block.py +++ b/scraper/block.py @@ -1,5 +1,5 @@ from py34 import Post -from py34.url import ImageURL, IMAGE_FORMATS +from py34.url import ImageURL, IMAGE_FORMATS, VIDEO_FORMATS from py34.scraper import scraper from typing import IO from io import BytesIO @@ -193,7 +193,7 @@ class BlockEntry: self.thumbnail = post.get_thumbnail_data() if self.type is None: - for ext in IMAGE_FORMATS: + for ext in VIDEO_FORMATS + IMAGE_FORMATS: image_url = ImageURL(post.image_dir, post.image_id, ext) status: int = None # CDN tends to return 503 : Service Unavailable