From 09110b49aa9af2cdcb56902f2014e8863b22c93c Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:49:42 -0400 Subject: [PATCH] Added Added quick Queue for category pages; cleaned up regex --- .../ripme/ripper/rippers/DuckmoviesRipper.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java index 1144f7fb..b20466ba 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java @@ -27,14 +27,17 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { @Override public boolean pageContainsAlbums(URL url) { - Pattern pa = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/models/([a-zA-Z0-9_-])+/?"); + Pattern pa = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/(models|category)/([a-zA-Z0-9_-])+/?"); Matcher ma = pa.matcher(url.toExternalForm()); if (ma.matches()) { return true; } - pa = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/models/([a-zA-Z0-9_-])+/page/\\d+/?"); + pa = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/(models|category)/([a-zA-Z0-9_-])+/page/\\d+/?"); ma = pa.matcher(url.toExternalForm()); - return ma.matches(); + if (ma.matches()) { + return true; + } + return false; } @Override @@ -108,12 +111,12 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { if (m.matches()) { return m.group(1); } - p = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/models/([a-zA-Z0-9_-])+/?"); + p = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/(category|models)/([a-zA-Z0-9_-])+/?"); m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); } - p = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/models/([a-zA-Z0-9_-])+/page/\\d+"); + p = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/(category|models)/([a-zA-Z0-9_-])+/page/\\d+"); m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1);