Added eroshare mirror eroshae

This commit is contained in:
cyian-1756 2017-08-09 17:01:10 -04:00
parent fdf82f5126
commit cdbdc995f1

View File

@ -51,13 +51,13 @@ public class EroShareRipper extends AbstractHTMLRipper {
} }
@Override @Override
public boolean canRip(URL url) { public boolean canRip(URL url) {
Pattern p = Pattern.compile("^https?://spacescience.tech/([a-zA-Z0-9\\-_]+)/?$"); Pattern p = Pattern.compile("^https?://eroshae.com/([a-zA-Z0-9\\-_]+)/?$");
Matcher m = p.matcher(url.toExternalForm()); Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) { if (m.matches()) {
return true; return true;
} }
Pattern pa = Pattern.compile("^https?://spacescience.tech/u/([a-zA-Z0-9\\-_]+)/?$"); Pattern pa = Pattern.compile("^https?://eroshae.com/u/([a-zA-Z0-9\\-_]+)/?$");
Matcher ma = pa.matcher(url.toExternalForm()); Matcher ma = pa.matcher(url.toExternalForm());
if (ma.matches()) { if (ma.matches()) {
return true; return true;
@ -78,7 +78,7 @@ public class EroShareRipper extends AbstractHTMLRipper {
} }
public boolean is_profile(URL url) { public boolean is_profile(URL url) {
Pattern pa = Pattern.compile("^https?://spacescience.tech/u/([a-zA-Z0-9\\-_]+)/?$"); Pattern pa = Pattern.compile("^https?://eroshae.com/u/([a-zA-Z0-9\\-_]+)/?$");
Matcher ma = pa.matcher(url.toExternalForm()); Matcher ma = pa.matcher(url.toExternalForm());
if (ma.matches()) { if (ma.matches()) {
return true; return true;
@ -98,7 +98,7 @@ public class EroShareRipper extends AbstractHTMLRipper {
if (nextUrl == "") { if (nextUrl == "") {
throw new IOException("No more pages"); throw new IOException("No more pages");
} }
return Http.url("spacescience.tech" + nextUrl).get(); return Http.url("eroshae.com" + nextUrl).get();
} }
@Override @Override
@ -146,7 +146,7 @@ public class EroShareRipper extends AbstractHTMLRipper {
for (Element link : links) { for (Element link : links) {
Document video_page; Document video_page;
try { try {
video_page = Http.url("spacescience.tech" + link.attr("href")).get(); video_page = Http.url("eroshae.com" + link.attr("href")).get();
} catch (IOException e) { } catch (IOException e) {
logger.warn("Failed to log link in Jsoup"); logger.warn("Failed to log link in Jsoup");
video_page = null; video_page = null;
@ -168,7 +168,7 @@ public class EroShareRipper extends AbstractHTMLRipper {
@Override @Override
public Document getFirstPage() throws IOException { public Document getFirstPage() throws IOException {
String urlToDownload = this.url.toExternalForm(); String urlToDownload = this.url.toExternalForm();
Response resp = Http.url(urlToDownload.replace("eroshare.com", "spacescience.tech")) Response resp = Http.url(urlToDownload.replace("eroshare.com", "eroshae.com"))
.ignoreContentType() .ignoreContentType()
.response(); .response();
@ -179,7 +179,7 @@ public class EroShareRipper extends AbstractHTMLRipper {
@Override @Override
public String getGID(URL url) throws MalformedURLException { public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://spacescience.tech/([a-zA-Z0-9\\-_]+)/?$"); Pattern p = Pattern.compile("^https?://eroshae.com/([a-zA-Z0-9\\-_]+)/?$");
Matcher m = p.matcher(url.toExternalForm()); Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) { if (m.matches()) {
return m.group(1); return m.group(1);
@ -197,13 +197,13 @@ public class EroShareRipper extends AbstractHTMLRipper {
return m_eroshare_profile.group(1) + "_profile"; return m_eroshare_profile.group(1) + "_profile";
} }
Pattern pa = Pattern.compile("^https?://spacescience.tech/u/([a-zA-Z0-9\\-_]+)/?$"); Pattern pa = Pattern.compile("^https?://eroshae.com/u/([a-zA-Z0-9\\-_]+)/?$");
Matcher ma = pa.matcher(url.toExternalForm()); Matcher ma = pa.matcher(url.toExternalForm());
if (ma.matches()) { if (ma.matches()) {
return m.group(1) + "_profile"; return m.group(1) + "_profile";
} }
throw new MalformedURLException("eroshare album not found in " + url + ", expected https://eroshare.com/album or spacescience.tech/album"); throw new MalformedURLException("eroshare album not found in " + url + ", expected https://eroshare.com/album or eroshae.com/album");
} }
public static List<URL> getURLs(URL url) throws IOException{ public static List<URL> getURLs(URL url) throws IOException{