Skip to content

Commit

Permalink
Fix ugoira support on Pixiv (fix #2610, fix #2487)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed May 4, 2022
1 parent 8846c39 commit 7e2f858
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sites/Pixiv/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ function parseImage(image: any, fromGallery: boolean): IImage {
img.preview_url = urlSampleToThumbnail(image["image_urls"]["medium"]);
}

// Ugoira replace first frame by ZIP path
if (/ugoira0/.test(img.file_url)){
img.sample_url = img.file_url;
img.file_url = img.file_url
.replace("img-original", "img-zip-ugoira")
.replace(/ugoira0\.(jpe?g|png|webp)/, "ugoira1920x1080.zip");
}

return img;
}

Expand Down

0 comments on commit 7e2f858

Please sign in to comment.