From e6f30670155819eaa0f9fc8f0e0549449c84d43b Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 14 Jun 2018 22:18:17 -0400 Subject: [PATCH 1/3] XhamsterRipper now accepts all countries subdomains --- .../java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java index 385f6d1f..b4529f9b 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java @@ -62,7 +62,7 @@ public class XhamsterRipper extends AbstractHTMLRipper { @Override public boolean canRip(URL url) { - Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/.*?(\\d+)$"); + Pattern p = Pattern.compile("^https?://[\\w\\w]*\\.xhamster\\.com/photos/gallery/.*?(\\d+)$"); Matcher m = p.matcher(url.toExternalForm()); return m.matches(); } From d7f39d9f9bb8b04a0beb1dd25bd8ac7e34e6f283 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 14 Jun 2018 22:23:27 -0400 Subject: [PATCH 2/3] Fixed regression with xhamster ripper that causes it to not accept links to the english version of xhamster.com --- .../java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java index b4529f9b..026a6a30 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java @@ -62,7 +62,7 @@ public class XhamsterRipper extends AbstractHTMLRipper { @Override public boolean canRip(URL url) { - Pattern p = Pattern.compile("^https?://[\\w\\w]*\\.xhamster\\.com/photos/gallery/.*?(\\d+)$"); + Pattern p = Pattern.compile("^https?://([\\w\\w]*\\.)?xhamster\\.com/photos/gallery/.*?(\\d+)$"); Matcher m = p.matcher(url.toExternalForm()); return m.matches(); } From 340c225dc601cf6f9c34761d1dc1ceb4520145e2 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 14 Jun 2018 22:25:41 -0400 Subject: [PATCH 3/3] Added unit test for non-english xhamster url --- .../ripme/tst/ripper/rippers/XhamsterRipperTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/XhamsterRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/XhamsterRipperTest.java index 54b22eb0..0a8e7f3c 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/XhamsterRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/XhamsterRipperTest.java @@ -17,6 +17,11 @@ public class XhamsterRipperTest extends RippersTest { testRipper(ripper); } + public void testBrazilianXhamster() throws IOException { + XhamsterRipper ripper = new XhamsterRipper(new URL("https://pt.xhamster.com/photos/gallery/silvana-7105696")); + testRipper(ripper); + } + public void testGetGID() throws IOException { URL url = new URL("https://xhamster.com/photos/gallery/japanese-dolls-4-asahi-mizuno-7254664"); XhamsterRipper ripper = new XhamsterRipper(url);