From fd9feabd421d18bd2cea09958194300e9995732f Mon Sep 17 00:00:00 2001 From: Bionus Date: Tue, 20 Feb 2024 22:37:26 +0100 Subject: [PATCH] source: use "video" sub-domain on r34.us for videos (fix #3083) --- src/sites/Rule34.us Gelbooru/model.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sites/Rule34.us Gelbooru/model.ts b/src/sites/Rule34.us Gelbooru/model.ts index 5e2755283..87f0d20f5 100755 --- a/src/sites/Rule34.us Gelbooru/model.ts +++ b/src/sites/Rule34.us Gelbooru/model.ts @@ -5,6 +5,12 @@ function completeImage(img: IImage): IImage { .replace("/thumbnail_", "/"); } + // Use the "video.rule34.us" server for videos to not get CloudFlare hot-linking error + const isVideo = img.tags && (img.tags as unknown as string).indexOf("video") !== -1; + if (isVideo && img.file_url && img.file_url.indexOf("//img") !== -1) { + img.file_url = img.file_url.replace(/\/\/img\d+\./, "//video."); + } + return img; }