From d2aeb4e218d96a44ec3a7d8049aa55e6d46a3ae0 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:38:45 -0400 Subject: [PATCH] Added quick Queue support --- .../ripper/rippers/DuckmoviesRipper.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) 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 2dbc8f9e..345560d9 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java @@ -20,6 +20,27 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { super(url); } + @Override + public boolean hasQueueSupport() { + return true; + } + + @Override + public boolean pageContainsAlbums(URL url) { + Pattern pa = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/models/([a-zA-Z0-9_-])+/?"); + Matcher ma = pa.matcher(url.toExternalForm()); + return ma.matches(); + } + + @Override + public List getAlbumsToQueue(Document doc) { + List urlsToAddToQueue = new ArrayList<>(); + for (Element elem : doc.select(".post > li > div > div > a")) { + urlsToAddToQueue.add(elem.attr("href")); + } + return urlsToAddToQueue; + } + private static List explicit_domains = Arrays.asList( "vidporntube.fun", @@ -82,6 +103,11 @@ 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_-])+/?"); + m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return m.group(1); + } throw new MalformedURLException( "Expected duckmovies format:"