From 4f43f1e2384751a146c3c591389f544d79f063b7 Mon Sep 17 00:00:00 2001 From: Ruthalas Date: Sat, 27 Jun 2020 22:15:04 -0700 Subject: [PATCH] Resolve xlecx error xlecx has changed its URL from 'xlecx.com' to 'xlecx.org'. This change modifies the ripper.java to reflect that change, and to add the required https prefix. If the https prefix is not added, the image download fails with 'no protocol'. That seems a little janky, but it was used in #120. --- .../com/rarchives/ripme/ripper/rippers/XcartxRipper.java | 2 +- .../com/rarchives/ripme/ripper/rippers/XlecxRipper.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/XcartxRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/XcartxRipper.java index 5ed01e6f..64829a0b 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XcartxRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XcartxRipper.java @@ -56,7 +56,7 @@ public class XcartxRipper extends AbstractHTMLRipper { for (Element image : imageElements) { String imageUrl = image.attr("data-src"); - imageURLs.add(getDomain() + imageUrl); + imageURLs.add("https://" + getDomain() + imageUrl); } return imageURLs; } diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/XlecxRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/XlecxRipper.java index 15aee9c9..0aaacfc4 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XlecxRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XlecxRipper.java @@ -8,7 +8,7 @@ import java.util.regex.Pattern; public class XlecxRipper extends XcartxRipper { - private Pattern p = Pattern.compile("^https?://xlecx.com/([a-zA-Z0-9_\\-]+).html"); + private Pattern p = Pattern.compile("^https?://xlecx.org/([a-zA-Z0-9_\\-]+).html"); public XlecxRipper(URL url) throws IOException { super(url); @@ -21,7 +21,7 @@ public class XlecxRipper extends XcartxRipper { @Override public String getDomain() { - return "xlecx.com"; + return "xlecx.org"; } @Override @@ -30,7 +30,7 @@ public class XlecxRipper extends XcartxRipper { if (m.matches()) { return m.group(1); } - throw new MalformedURLException("Expected URL format: http://xlecx.com/comic, got: " + url); + throw new MalformedURLException("Expected URL format: http://xlecx.org/comic, got: " + url); } }