Merge pull request #397 from rephormat/Pornhub-fix

Pornhub fix
This commit is contained in:
cyian-1756 2018-01-18 11:59:16 -05:00 committed by GitHub
commit 671aae2875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -68,11 +68,11 @@ public class PornhubRipper extends VideoRipper {
title = title.replaceAll("\\+", " ");
vidUrl = null;
for (String quality : new String[] {"quality_1080p", "quality_720p", "quality_480p", "quality_240p"}) {
Pattern pv = Pattern.compile("^.*var player_" + quality + " = '([^']*)'.*$", Pattern.DOTALL);
for (String quality : new String[] {"1080", "720", "480", "240"}) {
Pattern pv = Pattern.compile("\"quality\":\"" + quality + "\",\"videoUrl\":\"(.*?)\"");
Matcher mv = pv.matcher(html);
if (mv.matches()) {
vidUrl = mv.group(1);
if (mv.find()) {
vidUrl = mv.group(1).replace("\\/", "/");
break;
}
}

View File

@ -56,8 +56,6 @@ public class VideoRippersTest extends RippersTest {
}
}
// https://github.com/RipMeApp/ripme/issues/187
/*
public void testPornhubRipper() throws IOException {
List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URL("http://www.pornhub.com/view_video.php?viewkey=993166542"));
@ -66,7 +64,6 @@ public class VideoRippersTest extends RippersTest {
videoTestHelper(ripper);
}
}
*/
// https://github.com/RipMeApp/ripme/issues/186
/*