From fdf82f5126b3dc3f30ac66a7784e54315f113e61 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Sat, 29 Jul 2017 21:51:41 -0400 Subject: [PATCH] changed regex to include eroshare.com --- .../ripme/ripper/rippers/EroShareRipper.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/EroShareRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/EroShareRipper.java index a2ee74c6..054d6ba2 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/EroShareRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/EroShareRipper.java @@ -62,6 +62,18 @@ public class EroShareRipper extends AbstractHTMLRipper { if (ma.matches()) { return true; } + + Pattern p_eroshare = Pattern.compile("^https?://eroshare.com/([a-zA-Z0-9\\-_]+)/?$"); + Matcher m_eroshare = p_eroshare.matcher(url.toExternalForm()); + if (m_eroshare.matches()) { + return true; + } + + Pattern p_eroshare_profile = Pattern.compile("^https?://eroshare.com/u/([a-zA-Z0-9\\-_]+)/?$"); + Matcher m_eroshare_profile = p_eroshare_profile.matcher(url.toExternalForm()); + if (m_eroshare_profile.matches()) { + return true; + } return false; } @@ -155,7 +167,8 @@ public class EroShareRipper extends AbstractHTMLRipper { @Override public Document getFirstPage() throws IOException { - Response resp = Http.url(this.url) + String urlToDownload = this.url.toExternalForm(); + Response resp = Http.url(urlToDownload.replace("eroshare.com", "spacescience.tech")) .ignoreContentType() .response(); @@ -172,6 +185,18 @@ public class EroShareRipper extends AbstractHTMLRipper { return m.group(1); } + Pattern p_eroshare = Pattern.compile("^https?://eroshare.com/([a-zA-Z0-9\\-_]+)/?$"); + Matcher m_eroshare = p_eroshare.matcher(url.toExternalForm()); + if (m_eroshare.matches()) { + return m_eroshare.group(1); + } + + Pattern p_eroshare_profile = Pattern.compile("^https?://eroshare.com/u/([a-zA-Z0-9\\-_]+)/?$"); + Matcher m_eroshare_profile = p_eroshare_profile.matcher(url.toExternalForm()); + if (m_eroshare_profile.matches()) { + return m_eroshare_profile.group(1) + "_profile"; + } + Pattern pa = Pattern.compile("^https?://spacescience.tech/u/([a-zA-Z0-9\\-_]+)/?$"); Matcher ma = pa.matcher(url.toExternalForm()); if (ma.matches()) {