From cb66294d06e01b99689f45aa52ae4d19c1d273bd Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:13:47 -0400 Subject: [PATCH 1/7] Added basic ripper for some duckmovie front ends --- .../ripper/rippers/DuckmoviesRipper.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java new file mode 100644 index 00000000..c1ce130d --- /dev/null +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java @@ -0,0 +1,88 @@ +package com.rarchives.ripme.ripper.rippers; + +import com.rarchives.ripme.ripper.AbstractSingleFileRipper; +import com.rarchives.ripme.utils.Http; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class DuckmoviesRipper extends AbstractSingleFileRipper { + public DuckmoviesRipper(URL url) throws IOException { + super(url); + } + + + private static List explicit_domains = Arrays.asList( + "vidporntube.fun", + "pornbj.fun" + ); + + @Override + public String getHost() { + return url.toExternalForm().split("/")[2]; + } + + @Override + public String getDomain() { + return url.toExternalForm().split("/")[2]; + } + + @Override + public boolean canRip(URL url) { + String url_name = url.toExternalForm(); + return explicit_domains.contains(url_name.split("/")[2]); + } + + @Override + public Document getFirstPage() throws IOException { + return Http.url(this.url).get(); + } + + @Override + public List getURLsFromPage(Document doc) { + List results = new ArrayList<>(); + String duckMoviesUrl = doc.select("iframe").attr("src"); + try { + Document duckDoc = Http.url(new URL(duckMoviesUrl)).get(); + String videoURL = duckDoc.select("source").attr("src"); + // remove any white spaces so we can download the movie without a 400 error + videoURL = videoURL.replaceAll(" ", "%20"); + results.add(videoURL); + } catch (MalformedURLException e) { + LOGGER.error(duckMoviesUrl + " is not a valid url"); + } catch (IOException e) { + LOGGER.error("Unable to load page " + duckMoviesUrl); + e.printStackTrace(); + } + return results; + } + + + @Override + public String getGID(URL url) throws MalformedURLException { + Pattern p = Pattern.compile("https://[a-zA-Z0-9]+.fun/([a-zA-Z0-9\\-_]+)/?"); + Matcher m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return m.group(1); + } + + throw new MalformedURLException( + "Expected duckmovies format:" + + "domain.tld/Video-title" + + " Got: " + url); + } + + @Override + public void downloadURL(URL url, int index) { + addURLToDownload(url, getPrefix(index)); + } +} From 1bc6eb87d974e241bd4ac69f37c256efaf437403 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:22:40 -0400 Subject: [PATCH 2/7] Added more supported domains; the ripper now tries to resume downloads --- .../ripme/ripper/rippers/DuckmoviesRipper.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 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 c1ce130d..2dbc8f9e 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java @@ -23,8 +23,16 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { private static List explicit_domains = Arrays.asList( "vidporntube.fun", - "pornbj.fun" - ); + "pornbj.fun", + "iwantporn.fun", + "neoporn.fun", + "yayporn.fun", + "freshporn.co", + "palapaja.stream", + "freshporn.co", + "pornvidx.fun", + "palapaja.com" + ); @Override public String getHost() { @@ -69,7 +77,7 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("https://[a-zA-Z0-9]+.fun/([a-zA-Z0-9\\-_]+)/?"); + Pattern p = Pattern.compile("https://[a-zA-Z0-9]+\\.[a-zA-Z]+/([a-zA-Z0-9\\-_]+)/?"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); @@ -85,4 +93,7 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { public void downloadURL(URL url, int index) { addURLToDownload(url, getPrefix(index)); } + + @Override + public boolean tryResumeDownload() {return true;} } From d2aeb4e218d96a44ec3a7d8049aa55e6d46a3ae0 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:38:45 -0400 Subject: [PATCH 3/7] 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:" From 5c6d7d7e29370cf229489ae7e65c9234f8efd74d Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:42:58 -0400 Subject: [PATCH 4/7] Added quick Queue for all model pages --- .../ripme/ripper/rippers/DuckmoviesRipper.java | 10 ++++++++++ 1 file changed, 10 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 345560d9..1144f7fb 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java @@ -29,6 +29,11 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { 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()); + if (ma.matches()) { + return true; + } + pa = Pattern.compile("https?://[a-zA-Z0-9]+.[a-zA-Z]+/models/([a-zA-Z0-9_-])+/page/\\d+/?"); + ma = pa.matcher(url.toExternalForm()); return ma.matches(); } @@ -108,6 +113,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_-])+/page/\\d+"); + m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return m.group(1); + } throw new MalformedURLException( "Expected duckmovies format:" From 09110b49aa9af2cdcb56902f2014e8863b22c93c Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:49:42 -0400 Subject: [PATCH 5/7] 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); From e0b3819d247af72a0ece4d6f66a595f75267dd6a Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 01:55:15 -0400 Subject: [PATCH 6/7] Added duckmovies unit tests --- .../tst/ripper/rippers/DuckmoviesRipperTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/java/com/rarchives/ripme/tst/ripper/rippers/DuckmoviesRipperTest.java diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/DuckmoviesRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/DuckmoviesRipperTest.java new file mode 100644 index 00000000..b5e1fdad --- /dev/null +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/DuckmoviesRipperTest.java @@ -0,0 +1,15 @@ +package com.rarchives.ripme.tst.ripper.rippers; + +import com.rarchives.ripme.ripper.rippers.DuckmoviesRipper; + +import java.io.IOException; +import java.net.URL; + +public class DuckmoviesRipperTest extends RippersTest{ + + public void testRip() throws IOException { + DuckmoviesRipper ripper = new DuckmoviesRipper(new URL("https://palapaja.com/spyfam-stepbro-gives-in-to-stepsis-asian-persuasion/")); + testRipper(ripper); + } + +} \ No newline at end of file From 98b81c0915b115c579d2e69e6534972dd152c4cc Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Wed, 24 Oct 2018 02:44:23 -0400 Subject: [PATCH 7/7] fixed filing naming issue --- .../com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 b20466ba..48c1856c 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DuckmoviesRipper.java @@ -1,5 +1,6 @@ package com.rarchives.ripme.ripper.rippers; +import com.rarchives.ripme.ripper.AbstractRipper; import com.rarchives.ripme.ripper.AbstractSingleFileRipper; import com.rarchives.ripme.utils.Http; import org.jsoup.nodes.Document; @@ -130,7 +131,7 @@ public class DuckmoviesRipper extends AbstractSingleFileRipper { @Override public void downloadURL(URL url, int index) { - addURLToDownload(url, getPrefix(index)); + addURLToDownload(url, "", "", null, null, AbstractRipper.getFileName(url, null, null).replaceAll("%20", "_")); } @Override