From c5f6367fe655d674a7700fb04241643c5c1d045a Mon Sep 17 00:00:00 2001 From: rephormat Date: Wed, 23 Aug 2017 12:40:19 -0500 Subject: [PATCH] Fixes RipMeApp/ripme#57 --- .../ripme/ripper/rippers/video/XhamsterRipper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 061ec2fb..e559ebec 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 @@ -27,7 +27,7 @@ public class XhamsterRipper extends VideoRipper { @Override public boolean canRip(URL url) { - Pattern p = Pattern.compile("^https?://.*xhamster\\.com/movies/[0-9]+.*$"); + Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/.*$"); Matcher m = p.matcher(url.toExternalForm()); return m.matches(); } @@ -39,7 +39,7 @@ public class XhamsterRipper extends VideoRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("^https?://.*xhamster\\.com/movies/([0-9]+).*$"); + Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/.*$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); @@ -47,7 +47,8 @@ public class XhamsterRipper extends VideoRipper { throw new MalformedURLException( "Expected xhamster format:" - + "xhamster.com/movies/####" + + "xhamster.com/movies/#### or" + + "xhamster.com/videos/####" + " Got: " + url); } @@ -63,4 +64,4 @@ public class XhamsterRipper extends VideoRipper { addURLToDownload(new URL(vidUrl), HOST + "_" + getGID(this.url)); waitForThreads(); } -} \ No newline at end of file +}