Skip to content

Commit

Permalink
*Plugins: Fixes/Changes/Maintenance*
Browse files Browse the repository at this point in the history
- PornportalCom: fixed wrong tagging of official/progressive downloads as HLS items and fixed wrong linkIDs
- EvilangelCore: added simple detection of whether or not official download i possible, this isn't done right yet but works RE ticket #UWDA3318-JUSB-8135XCUW

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

Former-commit-id: 1ab53ed439d4a07d57fbb83b2dec1793dce3f999
  • Loading branch information
psp committed Sep 27, 2024
1 parent 773a1aa commit 24958d3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
15 changes: 7 additions & 8 deletions src/jd/plugins/decrypter/PornportalComCrawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,16 @@ public ArrayList<DownloadLink> crawlContentAPI(final PluginForHost plg, final St
}
final String codec = (String) videomap.get("codec");
String qualityIdentifier = (String) videomap.get("format");
final String streamType = (String) videomap.get("type");
final String streamType;
final long filesize = JavaScriptEngineFactory.toLong(videomap.get("sizeBytes"), 0);
final Map<String, Object> downloadInfo = (Map<String, Object>) urlsO;
String downloadurl = (String) downloadInfo.get("download");
if (StringUtils.isEmpty(downloadurl)) {
if (!StringUtils.isEmpty(downloadurl)) {
streamType = "progressive";
} else {
/* Fallback to stream-URL (most times, an official downloadurl is available!) */
downloadurl = (String) downloadInfo.get("view");
streamType = videomap.get("type").toString();
}
if (StringUtils.isEmpty(downloadurl)) {
continue;
Expand Down Expand Up @@ -296,16 +299,12 @@ public ArrayList<DownloadLink> crawlContentAPI(final PluginForHost plg, final St
}
dl.setContentUrl(contentURL);
final String originalFilename = UrlQuery.parse(downloadurl).get("filename");
String filenameQualityIdentifier = qualityIdentifier;
if ("hls".equals(streamType)) {
filenameQualityIdentifier += "_hls";
}
if (filenameScheme == FilenameScheme.ORIGINAL && originalFilename != null) {
dl.setFinalFileName(originalFilename);
} else if (filenameScheme == FilenameScheme.VIDEO_ID_TITLE_QUALITY_EXT) {
dl.setFinalFileName(itemID + "_" + title + "_" + filenameQualityIdentifier + ".mp4");
dl.setFinalFileName(itemID + "_" + title + "_" + qualityIdentifier + "_" + streamType + ".mp4");
} else {
dl.setFinalFileName(title + "_" + filenameQualityIdentifier + ".mp4");
dl.setFinalFileName(title + "_" + streamType + ".mp4");
}
dl.setProperty(PornportalCom.PROPERTY_VIDEO_ID, itemID);
dl.setProperty(PornportalCom.PROPERTY_VIDEO_QUALITY, qualityIdentifier);
Expand Down
29 changes: 27 additions & 2 deletions src/jd/plugins/hoster/EvilangelCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,34 @@ private AvailableStatus requestFileInformation(final DownloadLink link, final Ac
}
logger.info("Chose best quality: " + thisChosenQuality);
}
chosenQualityLabel = thisChosenQuality;
/*
* 2024-09-27: At this moment we do not yet know in beforehand if the user is allowed to do official downloads
* (there are also cheaper "stream only" accounts) -> Need to check.
*/
/* We can always use the file size as usually stream- and download sizes and available qualities are similar. */
filesize = download_file_sizes.get(thisChosenQuality).longValue();
dllink = String.format("https://members.%s/movieaction/download/%s/%s/mp4?codec=h264", getHost(), fileID, thisChosenQuality);
final String officialDownloadlink = String.format("https://members.%s/movieaction/download/%s/%s/mp4?codec=h264", getHost(), fileID, thisChosenQuality);
URLConnectionAdapter con = null;
try {
final Browser br_dltest = br.cloneBrowser();
con = br_dltest.openHeadConnection(officialDownloadlink);
if (this.looksLikeDownloadableContent(con)) {
this.dllink = officialDownloadlink;
chosenQualityLabel = thisChosenQuality;
filesize = con.getCompleteContentLength();
} else {
/* Typically http response 404 */
logger.info("Official download not possible: Received no file content");
}
} catch (final Throwable e) {
logger.log(e);
logger.info("Official download not possible: Exception");
} finally {
try {
con.disconnect();
} catch (final Throwable e) {
}
}
} else {
logger.info("Looks like official download is not possible");
}
Expand Down
3 changes: 2 additions & 1 deletion src/jd/plugins/hoster/PornportalCom.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ public boolean canHandle(final DownloadLink link, final Account account) throws
public String getLinkID(final DownloadLink link) {
final String videoid = link.getStringProperty(PROPERTY_VIDEO_ID);
final String videoquality = link.getStringProperty(PROPERTY_VIDEO_QUALITY);
final String videoStreamType = link.getStringProperty(PROPERTY_VIDEO_STREAM_TYPE);
final String galleryid = link.getStringProperty(PROPERTY_GALLERY_ID);
final int galleryImagePosition = link.getIntegerProperty(PROPERTY_GALLERY_IMAGE_POSITION, -1);
final int galleryPosition = link.getIntegerProperty(PROPERTY_GALLERY_POSITION, -1);
if (videoid != null && videoquality != null) {
return this.getHost() + "://video" + videoid + "/" + videoquality;
return this.getHost() + "://video" + videoid + "/" + videoquality + "/" + videoStreamType;
} else if (galleryid != null && galleryPosition != -1 && galleryImagePosition != -1) {
return this.getHost() + "://photo" + galleryid + "/" + galleryPosition + "/" + galleryImagePosition;
} else {
Expand Down

0 comments on commit 24958d3

Please sign in to comment.