1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-30 09:10:44 +02:00

meituri is tujigu RipMeApp#1894

https://github.com/RipMeApp/ripme/issues/1894
This commit is contained in:
soloturn
2021-06-06 16:14:23 +02:00
parent 9494f9ba43
commit 9a05be80a5
2 changed files with 10 additions and 11 deletions

View File

@@ -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++) {

View File

@@ -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));
}