*Plugins: Fixes/Changes/Maintenance*

PornportalCom:
- fixed missing thousand multiplier in directurl timestamp check
- fixed plugin mistakenly preferring new autio-only streams over video streams RE ticket #SJIL8198-AZLN-2353FMEI

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@49598 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: 3067c23911fe02f261e4deaf770b06d953353051
This commit is contained in:
psp 2024-08-16 13:53:00 +00:00
parent 74506766ab
commit 598517552a
2 changed files with 10 additions and 4 deletions

View File

@ -259,6 +259,7 @@ public class PornportalComCrawler extends PluginForDecrypt {
/* Usually empty list --> Usually means that current clip is not available as full clip -> Trailer only */
continue;
}
final String codec = (String) videomap.get("codec");
String qualityIdentifier = (String) videomap.get("format");
final String streamType = (String) videomap.get("type");
final long filesize = JavaScriptEngineFactory.toLong(videomap.get("sizeBytes"), 0);
@ -273,6 +274,9 @@ public class PornportalComCrawler extends PluginForDecrypt {
} else if (StringUtils.isEmpty(qualityIdentifier) || !qualityIdentifier.matches("\\d+p")) {
/* Skip invalid entries and hls and dash streams */
continue;
} else if (StringUtils.equalsIgnoreCase(codec, "av1")) {
/* 2024-08-16: Skip audio-only items */
continue;
}
/* E.g. '1080p' --> '1080' */
qualityIdentifier = qualityIdentifier.replace("p", "");

View File

@ -393,6 +393,9 @@ public class PornportalCom extends PluginForHost {
/* This should never happen */
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
if (account != null) {
this.login(this.br, account, link.getHost(), false);
}
URLConnectionAdapter con = null;
String newDirecturl = null;
try {
@ -402,8 +405,8 @@ public class PornportalCom extends PluginForHost {
* evaluate the "valid to" parameter stored inside the URL.
*/
final UrlQuery query = UrlQuery.parse(dllink);
final String expireTimestampMillisStr = query.get("validto");
if (expireTimestampMillisStr != null && expireTimestampMillisStr.matches("\\d+") && Long.parseLong(expireTimestampMillisStr) < System.currentTimeMillis()) {
final String expireTimestampStr = query.get("validto");
if (expireTimestampStr != null && expireTimestampStr.matches("\\d+") && Long.parseLong(expireTimestampStr) * 1000l < System.currentTimeMillis()) {
logger.info("Directurl is expired according to timestamp from URL-parameter");
refreshDirecturlNeeded = true;
}
@ -437,8 +440,7 @@ public class PornportalCom extends PluginForHost {
/* This should never happen */
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
/* We should already be loggedIN at this stage! */
this.login(this.br, account, link.getHost(), false);
// this.login(this.br, account, link.getHost(), false);
final PornportalComCrawler crawler = (PornportalComCrawler) this.getNewPluginForDecryptInstance(this.getHost());
final ArrayList<DownloadLink> results = crawler.crawlContentAPI(this, contentID, account, null);
final String targetLinkid = this.getLinkID(link);