Skip to content

Commit

Permalink
source: use "video" sub-domain on r34.us for videos (fix #3083)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Feb 20, 2024
1 parent a94e50e commit fd9feab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sites/Rule34.us Gelbooru/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fd9feab

Please # to comment.