mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-09-01 18:03:55 +02:00
meituri is tujigu RipMeApp#1894
https://github.com/RipMeApp/ripme/issues/1894
This commit is contained in:
@@ -21,12 +21,12 @@ public class MeituriRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getHost() {
|
public String getHost() {
|
||||||
return "meituri";
|
return "tujigu";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDomain() {
|
public String getDomain() {
|
||||||
return "meituri.com";
|
return "tujigu.com";
|
||||||
}
|
}
|
||||||
|
|
||||||
// To use in getting URLs
|
// To use in getting URLs
|
||||||
@@ -35,18 +35,18 @@ public class MeituriRipper extends AbstractHTMLRipper {
|
|||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
// without escape
|
// without escape
|
||||||
// ^https?://[w.]*meituri\.com/a/([0-9]+)/([0-9]+\.html)*$
|
// ^https?://[w.]*tujigu\.com/a/([0-9]+)/([0-9]+\.html)*$
|
||||||
// https://www.meituri.com/a/14449/
|
// https://www.tujigu.com/a/14449/
|
||||||
// also matches https://www.meituri.com/a/14449/3.html etc.
|
// also matches https://www.tujigu.com/a/14449/3.html etc.
|
||||||
// group 1 is 14449
|
// 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());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
albumID = m.group(1);
|
albumID = m.group(1);
|
||||||
return m.group(1);
|
return m.group(1);
|
||||||
}
|
}
|
||||||
throw new MalformedURLException(
|
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
|
@Override
|
||||||
@@ -71,7 +71,7 @@ public class MeituriRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Base URL: http://ii.hywly.com/a/1/albumid/imgnum.jpg
|
// 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
|
// Loop through and add images to the URL list
|
||||||
for (int i = 1; i <= numOfImages; i++) {
|
for (int i = 1; i <= numOfImages; i++) {
|
||||||
|
@@ -11,15 +11,14 @@ import org.junit.jupiter.api.Test;
|
|||||||
|
|
||||||
public class MeituriRipperTest extends RippersTest {
|
public class MeituriRipperTest extends RippersTest {
|
||||||
@Test
|
@Test
|
||||||
@Disabled("Broken ripper")
|
|
||||||
public void testMeituriRip() throws IOException {
|
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);
|
testRipper(ripper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetGID() throws IOException {
|
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);
|
MeituriRipper ripper = new MeituriRipper(url);
|
||||||
Assertions.assertEquals("14449", ripper.getGID(url));
|
Assertions.assertEquals("14449", ripper.getGID(url));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user