From f7ae0e8d96c2e8f537b7138e6b674fa67a2bbae2 Mon Sep 17 00:00:00 2001 From: rephormat Date: Fri, 12 Jan 2018 19:24:40 -0600 Subject: [PATCH 1/6] Add yuvutu.com ripper. --- .../ripme/ripper/rippers/YuvutuRipper.java | 70 ++++++++++++++++ .../ripper/rippers/video/YuvutuRipper.java | 82 +++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 src/main/java/com/rarchives/ripme/ripper/rippers/YuvutuRipper.java create mode 100644 src/main/java/com/rarchives/ripme/ripper/rippers/video/YuvutuRipper.java diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/YuvutuRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/YuvutuRipper.java new file mode 100644 index 00000000..97365aa8 --- /dev/null +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/YuvutuRipper.java @@ -0,0 +1,70 @@ +package com.rarchives.ripme.ripper.rippers; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; + +import com.rarchives.ripme.ripper.AbstractHTMLRipper; +import com.rarchives.ripme.utils.Http; + +public class YuvutuRipper extends AbstractHTMLRipper { + + private static final String DOMAIN = "yuvutu.com", + HOST = "yuvutu"; + + public YuvutuRipper(URL url) throws IOException { + super(url); + } + + @Override + public String getHost() { + return HOST; + } + @Override + public String getDomain() { + return DOMAIN; + } + + @Override + public boolean canRip(URL url) { + Pattern p = Pattern.compile("^http://www\\.yuvutu\\.com/modules\\.php\\?name=YuGallery&action=view&set_id=([0-9]+)$"); + Matcher m = p.matcher(url.toExternalForm()); + return m.matches(); + } + + @Override + public String getGID(URL url) throws MalformedURLException { + Pattern p = Pattern.compile("^http://www\\.yuvutu\\.com/modules\\.php\\?name=YuGallery&action=view&set_id=([0-9]+)$"); + Matcher m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return m.group(1); + } + throw new MalformedURLException("Expected yuvutu.com URL format: " + + "yuvutu.com/modules.php?name=YuGallery&action=view&set_id=albumid - got " + url + "instead"); + } + + @Override + public Document getFirstPage() throws IOException { + return Http.url(url).get(); + } + @Override + public List getURLsFromPage(Document doc) { + List imageURLs = new ArrayList<>(); + for (Element thumb : doc.select("div#galleria > a > img")) { + String image = thumb.attr("src"); + imageURLs.add(image); + } + return imageURLs; + } + @Override + public void downloadURL(URL url, int index) { + addURLToDownload(url, getPrefix(index)); + } +} diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/video/YuvutuRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/video/YuvutuRipper.java new file mode 100644 index 00000000..f455abe2 --- /dev/null +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/video/YuvutuRipper.java @@ -0,0 +1,82 @@ +package com.rarchives.ripme.ripper.rippers.video; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + + +import com.rarchives.ripme.ripper.VideoRipper; +import com.rarchives.ripme.utils.Http; + +public class YuvutuRipper extends VideoRipper { + + private static final String HOST = "yuvutu"; + + public YuvutuRipper(URL url) throws IOException { + super(url); + } + + @Override + public String getHost() { + return HOST; + } + + @Override + public boolean canRip(URL url) { + Pattern p = Pattern.compile("^http://www\\.yuvutu\\.com/video/[0-9]+/(.*)$"); + Matcher m = p.matcher(url.toExternalForm()); + return m.matches(); + } + + @Override + public URL sanitizeURL(URL url) throws MalformedURLException { + return url; + } + + @Override + public String getGID(URL url) throws MalformedURLException { + Pattern p = Pattern.compile("^http://www\\.yuvutu\\.com/video/[0-9]+/(.*)$"); + Matcher m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return m.group(1); + } + + throw new MalformedURLException( + "Expected yuvutu format:" + + "yuvutu.com/video/####" + + " Got: " + url); + } + + @Override + public void rip() throws IOException { + logger.info("Retrieving " + this.url); + Document doc = Http.url(url).get(); + Element iframe = doc.select("iframe").first(); + String iframeSrc = iframe.attr("src"); + if (iframeSrc != null) { + doc = Http.url("http://www.yuvutu.com" + iframeSrc).get(); + } else { + throw new IOException("Could not find iframe code at " + url); + } + Elements script = doc.select("script"); + if (script.size() == 0) { + throw new IOException("Could not find script code at " + url); + } + Pattern p = Pattern.compile("file: \"(.*?)\""); + + for (Element element : script) { + Matcher m = p.matcher(element.data()); + if (m.find()){ + String vidUrl = m.group(1); + addURLToDownload(new URL(vidUrl), HOST + "_" + getGID(this.url)); + } + } + waitForThreads(); + } +} From 4464fa873aa9d7c6159a072f4bf99f0fdc02b43c Mon Sep 17 00:00:00 2001 From: rephormat Date: Sat, 13 Jan 2018 09:31:35 -0600 Subject: [PATCH 2/6] Add yuvutu.com ripper test. --- .../tst/ripper/rippers/YuvutuRipperTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/java/com/rarchives/ripme/tst/ripper/rippers/YuvutuRipperTest.java diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/YuvutuRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/YuvutuRipperTest.java new file mode 100644 index 00000000..a74b76e9 --- /dev/null +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/YuvutuRipperTest.java @@ -0,0 +1,19 @@ +package com.rarchives.ripme.tst.ripper.rippers; + +import java.io.IOException; +import java.net.URL; + +import com.rarchives.ripme.ripper.rippers.YuvutuRipper; + +public class YuvutuRipperTest extends RippersTest { + + public void testYuvutuAlbum1() throws IOException { + YuvutuRipper ripper = new YuvutuRipper(new URL("http://www.yuvutu.com/modules.php?name=YuGallery&action=view&set_id=127013")); + testRipper(ripper); + } + + public void testYuvutuAlbum2() throws IOException { + YuvutuRipper ripper = new YuvutuRipper(new URL("http://www.yuvutu.com/modules.php?name=YuGallery&action=view&set_id=420333")); + testRipper(ripper); + } +} From 38231c82de85b25e9418b0582f862b3cbe9ed25b Mon Sep 17 00:00:00 2001 From: reph Date: Sat, 13 Jan 2018 18:40:15 -0600 Subject: [PATCH 3/6] Add yuvutu.com video ripper test. --- .../ripme/tst/ripper/rippers/VideoRippersTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java index 73c818d0..80abe56e 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java @@ -10,6 +10,7 @@ import com.rarchives.ripme.ripper.rippers.video.PornhubRipper; import com.rarchives.ripme.ripper.rippers.video.VineRipper; import com.rarchives.ripme.ripper.rippers.video.XvideosRipper; import com.rarchives.ripme.ripper.rippers.video.YoupornRipper; +import com.rarchives.ripme.ripper.rippers.video.YuvutuRipper; public class VideoRippersTest extends RippersTest { @@ -77,5 +78,14 @@ public class VideoRippersTest extends RippersTest { videoTestHelper(ripper); } } + + public void testYuvutuRipper() throws IOException { + List contentURLs = new ArrayList<>(); + contentURLs.add(new URL("http://www.yuvutu.com/video/828499/female-reader-armpit-job/")); + for (URL url : contentURLs) { + YuvutuRipper ripper = new YuvutuRipper(url); + videoTestHelper(ripper); + } + } } From 81f804e61f7c7b58c7d26adbdbb168f7462fad2f Mon Sep 17 00:00:00 2001 From: reph Date: Sat, 13 Jan 2018 21:23:44 -0600 Subject: [PATCH 4/6] Fixes xhamster.com video ripper. --- .../ripme/ripper/rippers/video/XhamsterRipper.java | 6 +++--- .../ripme/tst/ripper/rippers/VideoRippersTest.java | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/video/XhamsterRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/video/XhamsterRipper.java index e559ebec..b30f5a1a 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/video/XhamsterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/video/XhamsterRipper.java @@ -39,10 +39,10 @@ public class XhamsterRipper extends VideoRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/.*$"); + Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/(.*)$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { - return m.group(1); + return m.group(2); } throw new MalformedURLException( @@ -56,7 +56,7 @@ public class XhamsterRipper extends VideoRipper { public void rip() throws IOException { logger.info("Retrieving " + this.url); Document doc = Http.url(url).get(); - Elements videos = doc.select("a.mp4Thumb"); + Elements videos = doc.select("div.player-container > a"); if (videos.size() == 0) { throw new IOException("Could not find Embed code at " + url); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java index 73c818d0..f4566c11 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VideoRippersTest.java @@ -8,6 +8,7 @@ import java.util.List; import com.rarchives.ripme.ripper.VideoRipper; import com.rarchives.ripme.ripper.rippers.video.PornhubRipper; import com.rarchives.ripme.ripper.rippers.video.VineRipper; +import com.rarchives.ripme.ripper.rippers.video.XhamsterRipper; import com.rarchives.ripme.ripper.rippers.video.XvideosRipper; import com.rarchives.ripme.ripper.rippers.video.YoupornRipper; @@ -35,6 +36,15 @@ public class VideoRippersTest extends RippersTest { } } + public void testXhamsterRipper() throws IOException { + List contentURLs = new ArrayList<>(); + contentURLs.add(new URL("https://xhamster.com/videos/brazzers-busty-big-booty-milf-lisa-ann-fucks-her-masseur-1492828")); + for (URL url : contentURLs) { + XhamsterRipper ripper = new XhamsterRipper(url); + videoTestHelper(ripper); + } + } + public void testXvideosRipper() throws IOException { List contentURLs = new ArrayList<>(); contentURLs.add(new URL("https://www.xvideos.com/video19719109/ziggy_star_ultra_hard_anal_pounding")); From c1e2edd82d84b4f39248c27c20945324b89a1720 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 15 Jan 2018 00:29:11 -0500 Subject: [PATCH 5/6] disabled FuskatorRipperTest --- .../ripper/rippers/FuskatorRipperTest.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuskatorRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuskatorRipperTest.java index f5bc6f0d..20c8473d 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuskatorRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/FuskatorRipperTest.java @@ -1,13 +1,15 @@ -package com.rarchives.ripme.tst.ripper.rippers; +//package com.rarchives.ripme.tst.ripper.rippers; +// +//import java.io.IOException; +//import java.net.URL; +// +//import com.rarchives.ripme.ripper.rippers.FuskatorRipper; +// +//public class FuskatorRipperTest extends RippersTest { +// public void testFuskatorAlbum() throws IOException { +// FuskatorRipper ripper = new FuskatorRipper(new URL("https://fuskator.com/thumbs/hqt6pPXAf9z/Shaved-Blonde-Babe-Katerina-Ambre.html")); +// testRipper(ripper); +// } +//} -import java.io.IOException; -import java.net.URL; - -import com.rarchives.ripme.ripper.rippers.FuskatorRipper; - -public class FuskatorRipperTest extends RippersTest { - public void testFuskatorAlbum() throws IOException { - FuskatorRipper ripper = new FuskatorRipper(new URL("https://fuskator.com/thumbs/hqt6pPXAf9z/Shaved-Blonde-Babe-Katerina-Ambre.html")); - testRipper(ripper); - } -} +// Disabled because of https://github.com/RipMeApp/ripme/issues/393 \ No newline at end of file From 20e59499bc806cd4d55a61ff85214c43d0cc9ab8 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Tue, 16 Jan 2018 06:03:10 -0500 Subject: [PATCH 6/6] 1.7.13: disabled FuskatorRipperTest; Fixes xhamster.com video ripper; Add yuvutu.com ripper --- pom.xml | 2 +- ripme.json | 3 ++- src/main/java/com/rarchives/ripme/ui/UpdateUtils.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index fe587fb9..c9310063 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rarchives.ripme ripme jar - 1.7.12 + 1.7.13 ripme http://rip.rarchives.com diff --git a/ripme.json b/ripme.json index 55b96a97..5051e28b 100644 --- a/ripme.json +++ b/ripme.json @@ -1,6 +1,7 @@ { - "latestVersion": "1.7.12", + "latestVersion": "1.7.13", "changeList": [ + "1.7.13: disabled FuskatorRipperTest; Fixes xhamster.com video ripper; Add yuvutu.com ripper", "1.7.12: Instagram ripper no longer 403s on certain images", "1.7.11: Added gwarchives support to the cheveretoRipper; Gfycat Tests & Fix for bad reddit submissions; instagram ripper can now be made to skip videos", "1.7.10: Added basic pornpics.com ripper; Fixed hentai.cafe regex", diff --git a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java index 15654f5a..e6e9ab52 100644 --- a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java +++ b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java @@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils; public class UpdateUtils { private static final Logger logger = Logger.getLogger(UpdateUtils.class); - private static final String DEFAULT_VERSION = "1.7.12"; + private static final String DEFAULT_VERSION = "1.7.13"; private static final String REPO_NAME = "ripmeapp/ripme"; private static final String updateJsonURL = "https://raw.githubusercontent.com/" + REPO_NAME + "/master/ripme.json"; private static final String mainFileName = "ripme.jar";