From 52099926ccc9c962fac5634d5f0743d1f219ea4d Mon Sep 17 00:00:00 2001 From: rephormat <> Date: Wed, 7 Feb 2018 13:59:37 -0600 Subject: [PATCH] Fix regex and skip quality with upsell designation. --- .../rarchives/ripme/ripper/rippers/video/PornhubRipper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/video/PornhubRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/video/PornhubRipper.java index 88207123..ea98bcfd 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/video/PornhubRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/video/PornhubRipper.java @@ -28,7 +28,7 @@ public class PornhubRipper extends VideoRipper { @Override public boolean canRip(URL url) { - Pattern p = Pattern.compile("^https?://[wm.]*pornhub\\.com/view_video.php\\?viewkey=[0-9]+.*$"); + Pattern p = Pattern.compile("^https?://[wm.]*pornhub\\.com/view_video.php\\?viewkey=[a-z0-9]+$"); Matcher m = p.matcher(url.toExternalForm()); return m.matches(); } @@ -40,7 +40,7 @@ public class PornhubRipper extends VideoRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("^https?://[wm.]*pornhub\\.com/view_video.php\\?viewkey=([0-9]+).*$"); + Pattern p = Pattern.compile("^https?://[wm.]*pornhub\\.com/view_video.php\\?viewkey=([a-z0-9]+)$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); @@ -69,7 +69,7 @@ public class PornhubRipper extends VideoRipper { vidUrl = null; for (String quality : new String[] {"1080", "720", "480", "240"}) { - Pattern pv = Pattern.compile("\"quality\":\"" + quality + "\",\"videoUrl\":\"(.*?)\""); + Pattern pv = Pattern.compile("\"format\":\"\",\"quality\":\"" + quality + "\",\"videoUrl\":\"(.*?)\""); Matcher mv = pv.matcher(html); if (mv.find()) { vidUrl = mv.group(1).replace("\\/", "/");