From dbf153446bc92627d02fa688bd3ceaa2103b4689 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 2 Nov 2018 14:56:30 -0400 Subject: [PATCH] Fixed mangadex ripper --- .../rarchives/ripme/ripper/rippers/MangadexRipper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/MangadexRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/MangadexRipper.java index 727a6575..6697a45b 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/MangadexRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/MangadexRipper.java @@ -19,8 +19,8 @@ import java.util.regex.Pattern; public class MangadexRipper extends AbstractJSONRipper { private String chapterApiEndPoint = "https://mangadex.org/api/chapter/"; - private String getImageUrl(String chapterHash, String imageName) { - return "https://mangadex.org/data/" + chapterHash + "/" + imageName; + private String getImageUrl(String chapterHash, String imageName, String server) { + return server + chapterHash + "/" + imageName; } public MangadexRipper(URL url) throws IOException { @@ -72,11 +72,13 @@ public class MangadexRipper extends AbstractJSONRipper { JSONArray currentObject; String chapterHash = json.getString("hash"); + // Server is the cdn hosting the images. + String server = json.getString("server"); for (int i = 0; i < json.getJSONArray("page_array").length(); i++) { currentObject = json.getJSONArray("page_array"); - assetURLs.add(getImageUrl(chapterHash, currentObject.getString(i))); + assetURLs.add(getImageUrl(chapterHash, currentObject.getString(i), server)); } return assetURLs;