From 06e88efedf060354671e3801686d1f2c2fa0860a Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 22 Feb 2017 01:24:52 -0500 Subject: [PATCH] removed the unused g subdomain from the ehentai ripper (#453) --- .../ripme/ripper/rippers/EHentaiRipper.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/EHentaiRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/EHentaiRipper.java index 44790487..a622d832 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/EHentaiRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/EHentaiRipper.java @@ -38,7 +38,7 @@ public class EHentaiRipper extends AbstractHTMLRipper { // Current HTML document private Document albumDoc = null; - + private static final Map cookies = new HashMap(); static { cookies.put("nw", "1"); @@ -53,10 +53,10 @@ public class EHentaiRipper extends AbstractHTMLRipper { public String getHost() { return "e-hentai"; } - + @Override public String getDomain() { - return "g.e-hentai.org"; + return "e-hentai.org"; } public String getAlbumTitle(URL url) throws MalformedURLException { @@ -79,18 +79,18 @@ public class EHentaiRipper extends AbstractHTMLRipper { Pattern p; Matcher m; - p = Pattern.compile("^.*g\\.e-hentai\\.org/g/([0-9]+)/([a-fA-F0-9]+)/$"); + p = Pattern.compile("^https?://e-hentai\\.org/g/([0-9]+)/([a-fA-F0-9]+)/$"); m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1) + "-" + m.group(2); } throw new MalformedURLException( - "Expected g.e-hentai.org gallery format: " - + "http://g.e-hentai.org/g/####/####/" + "Expected e-hentai.org gallery format: " + + "http://e-hentai.org/g/####/####/" + " Got: " + url); } - + /** * Attempts to get page, checks for IP ban, waits. * @param url @@ -185,7 +185,7 @@ public class EHentaiRipper extends AbstractHTMLRipper { /** * Helper class to find and download images found on "image" pages - * + * * Handles case when site has IP-banned the user. */ private class EHentaiImageThread extends Thread { @@ -204,7 +204,7 @@ public class EHentaiRipper extends AbstractHTMLRipper { public void run() { fetchImage(); } - + private void fetchImage() { try { Document doc = getPageWithRetries(this.url); @@ -246,4 +246,4 @@ public class EHentaiRipper extends AbstractHTMLRipper { } } } -} \ No newline at end of file +}