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 6cf986a7..490d1e28 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java @@ -23,7 +23,7 @@ public class XhamsterRipper extends AlbumRipper { @Override public boolean canRip(URL url) { - Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/[0-9]+.*$"); + Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/.*[0-9]+$"); Matcher m = p.matcher(url.toExternalForm()); return m.matches(); } @@ -87,14 +87,14 @@ public class XhamsterRipper extends AlbumRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("^https?://([a-z0-9.]*?)xhamster\\.com/photos/gallery/([0-9]{1,})/.*\\.html"); + Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/.*?(\\d{1,})$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { - return m.group(2); + return m.group(1); } throw new MalformedURLException( "Expected xhamster.com gallery formats: " - + "xhamster.com/photos/gallery/#####/xxxxx..html" + + "xhamster.com/photos/gallery/xxxxx-#####" + " Got: " + url); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/BasicRippersTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/BasicRippersTest.java index 153288d8..b7b79f1f 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/BasicRippersTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/BasicRippersTest.java @@ -276,7 +276,7 @@ public class BasicRippersTest extends RippersTest { } public void testXhamsterAlbums() throws IOException { - XhamsterRipper ripper = new XhamsterRipper(new URL("http://xhamster.com/photos/gallery/1462237/alyssa_gadson.html")); + XhamsterRipper ripper = new XhamsterRipper(new URL("https://xhamster.com/photos/gallery/volleyball-sluts-8305007")); testRipper(ripper); } }