1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-26 23:34:53 +02:00

Merge pull request #1375 from rephormat/pornhubUpsellFix

Pornhub upsell fix
This commit is contained in:
cyian-1756
2019-07-19 23:42:12 -05:00
committed by GitHub

View File

@@ -69,12 +69,14 @@ public class PornhubRipper extends VideoRipper {
int bestQual = 0; int bestQual = 0;
for (int i = 0; i < mediaDef.length(); i++) { for (int i = 0; i < mediaDef.length(); i++) {
JSONObject e = (JSONObject) mediaDef.get(i); JSONObject e = (JSONObject) mediaDef.get(i);
if (!"upsell".equals(e.getString("format"))) {
int quality = Integer.parseInt((String)e.get("quality")); int quality = Integer.parseInt((String)e.get("quality"));
if (quality > bestQual) { if (quality > bestQual) {
bestQual = quality; bestQual = quality;
vidUrl = (String)e.get("videoUrl"); vidUrl = (String)e.get("videoUrl");
} }
} }
}
if (vidUrl == null) { if (vidUrl == null) {
throw new IOException("Unable to find encrypted video URL at " + this.url); throw new IOException("Unable to find encrypted video URL at " + this.url);
} }