From 99d6fb0d06478824c69a4bc188f20a2357aa0d51 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 16 Nov 2018 05:47:46 -0500 Subject: [PATCH] Added support for hqporner videos hosted on flyflv --- .../ripme/ripper/rippers/HqpornerRipper.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/HqpornerRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/HqpornerRipper.java index e95467bb..1fa27618 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/HqpornerRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/HqpornerRipper.java @@ -39,6 +39,26 @@ public class HqpornerRipper extends AbstractSingleFileRipper { return null; } + private String getVideoFromFlyFlv(String url) { + try { + logger.info("Downloading " + url); + Document page = Http.url(url).referrer(url).get(); + String[] videoSizes = { "1080p","720p","360p"}; + for (String videoSize : videoSizes) { + String urlToReturn = page.select("video > source[label=" + videoSize).attr("src"); + if (urlToReturn != null && !urlToReturn.equals("")) { + return urlToReturn; + } + } + + + + } catch (IOException e) { + logger.error("Unable to get page with video"); + } + return null; + } + private String getVideoName() { try { String filename = getGID(url); @@ -77,8 +97,19 @@ public class HqpornerRipper extends AbstractSingleFileRipper { @Override public List getURLsFromPage(Document doc) { + String videoUrl = null; List result = new ArrayList<>(); - result.add("https:" + getVideoFromMyDaddycc("https:" + doc.select("div.videoWrapper > iframe").attr("src"))); + String videoPageUrl = "https:" + doc.select("div.videoWrapper > iframe").attr("src"); + + if (videoPageUrl.contains("mydaddy")) { + videoUrl = getVideoFromMyDaddycc(videoPageUrl); + } else if (videoPageUrl.contains("flyflv")) { + videoUrl = getVideoFromFlyFlv(videoPageUrl); + } + + if (videoUrl != null) { + result.add("https:" + videoUrl); + } return result; }