From edd6dfa0a3f45bf05567aa9a9bd034bff67e0439 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 3 Nov 2017 00:01:13 -0400 Subject: [PATCH] Can now rip all webtoons comics --- .../rarchives/ripme/ripper/rippers/WebtoonsRipper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/WebtoonsRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/WebtoonsRipper.java index 96471c72..5541fb98 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/WebtoonsRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/WebtoonsRipper.java @@ -37,7 +37,7 @@ public class WebtoonsRipper extends AbstractHTMLRipper { @Override public boolean canRip(URL url) { - Pattern pat = Pattern.compile("https?://www\\.webtoons\\.com/[a-zA-Z]+/[a-zA-Z]+/([a-zA-Z0-9_-]*)/ep-\\d+/\\S*"); + Pattern pat = Pattern.compile("https?://www.webtoons.com/[a-zA-Z]+/[a-zA-Z]+/([a-zA-Z0-9_-]*)/[a-zA-Z0-9_-]+/\\S*"); Matcher mat = pat.matcher(url.toExternalForm()); if (mat.matches()) { return true; @@ -48,7 +48,7 @@ public class WebtoonsRipper extends AbstractHTMLRipper { @Override public String getAlbumTitle(URL url) throws MalformedURLException { - Pattern pat = Pattern.compile("https?://www\\.webtoons\\.com/[a-zA-Z]+/[a-zA-Z]+/([a-zA-Z0-9_-]*)/ep-\\d+/\\S*"); + Pattern pat = Pattern.compile("https?://www.webtoons.com/[a-zA-Z]+/[a-zA-Z]+/([a-zA-Z0-9_-]*)/[a-zA-Z0-9_-]+/\\S*"); Matcher mat = pat.matcher(url.toExternalForm()); if (mat.matches()) { return mat.group(1); @@ -59,7 +59,7 @@ public class WebtoonsRipper extends AbstractHTMLRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern pat = Pattern.compile("https?://www\\.webtoons\\.com/[a-zA-Z]+/[a-zA-Z]+/([a-zA-Z0-9_-]*)/ep-\\d+/\\S*"); + Pattern pat = Pattern.compile("https?://www.webtoons.com/[a-zA-Z]+/[a-zA-Z]+/([a-zA-Z0-9_-]*)/[a-zA-Z0-9_-]+/\\S*"); Matcher mat = pat.matcher(url.toExternalForm()); if (mat.matches()) { return mat.group(1); @@ -95,7 +95,7 @@ public class WebtoonsRipper extends AbstractHTMLRipper { String nextUrl = ""; Element elem = doc.select("a.pg_next").first(); nextUrl = elem.attr("href"); - if (nextUrl == "") { + if (nextUrl.equals("") || nextUrl.equals("#")) { throw new IOException("No more pages"); } return Http.url(nextUrl).get();