From 9a05be80a573cc356985135cdf38ace5fc5aca9a Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 6 Jun 2021 16:14:23 +0200 Subject: [PATCH] meituri is tujigu RipMeApp#1894 https://github.com/RipMeApp/ripme/issues/1894 --- .../ripme/ripper/rippers/MeituriRipper.java | 16 ++++++++-------- .../tst/ripper/rippers/MeituriRipperTest.java | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/MeituriRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/MeituriRipper.java index 8bdd2b2f..d5c198bb 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/MeituriRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/MeituriRipper.java @@ -21,12 +21,12 @@ public class MeituriRipper extends AbstractHTMLRipper { @Override public String getHost() { - return "meituri"; + return "tujigu"; } @Override public String getDomain() { - return "meituri.com"; + return "tujigu.com"; } // To use in getting URLs @@ -35,18 +35,18 @@ public class MeituriRipper extends AbstractHTMLRipper { @Override public String getGID(URL url) throws MalformedURLException { // without escape - // ^https?://[w.]*meituri\.com/a/([0-9]+)/([0-9]+\.html)*$ - // https://www.meituri.com/a/14449/ - // also matches https://www.meituri.com/a/14449/3.html etc. + // ^https?://[w.]*tujigu\.com/a/([0-9]+)/([0-9]+\.html)*$ + // https://www.tujigu.com/a/14449/ + // also matches https://www.tujigu.com/a/14449/3.html etc. // group 1 is 14449 - Pattern p = Pattern.compile("^https?://[w.]*meituri\\.com/a/([0-9]+)/([0-9]+\\.html)*$"); + Pattern p = Pattern.compile("^https?://[w.]*tujigu\\.com/a/([0-9]+)/([0-9]+\\.html)*$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { albumID = m.group(1); return m.group(1); } throw new MalformedURLException( - "Expected meituri.com URL format: " + "meituri.com/a/albumid/ - got " + url + "instead"); + "Expected tujigu.com URL format: " + "tujigu.com/a/albumid/ - got " + url + "instead"); } @Override @@ -71,7 +71,7 @@ public class MeituriRipper extends AbstractHTMLRipper { } // Base URL: http://ii.hywly.com/a/1/albumid/imgnum.jpg - String baseURL = "http://ii.hywly.com/a/1/" + albumID + "/"; + String baseURL = "https://tjg.hywly.com/a/1/" + albumID + "/"; // Loop through and add images to the URL list for (int i = 1; i <= numOfImages; i++) { diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MeituriRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MeituriRipperTest.java index 883b73e3..d34325e3 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MeituriRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MeituriRipperTest.java @@ -11,15 +11,14 @@ import org.junit.jupiter.api.Test; public class MeituriRipperTest extends RippersTest { @Test - @Disabled("Broken ripper") public void testMeituriRip() throws IOException { - MeituriRipper ripper = new MeituriRipper(new URL("https://www.meituri.com/a/14449/")); + MeituriRipper ripper = new MeituriRipper(new URL("https://www.tujigu.com/a/14449/")); testRipper(ripper); } @Test public void testGetGID() throws IOException { - URL url = new URL("https://www.meituri.com/a/14449/"); + URL url = new URL("https://www.tujigu.com/a/14449/"); MeituriRipper ripper = new MeituriRipper(url); Assertions.assertEquals("14449", ripper.getGID(url)); }