*General*

- cleanup: removed some old rtmp download related stuff

*Plugins: Fixes/Changes/Maintenance*
- AbloadDeGallery: added errorhandling for empty galleries RE forum 91884
- bunkr: optimized for some edge cases RE forum 91374

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

Former-commit-id: 0cff4e23b04412bee0e18e5ee77daac599377b3a
This commit is contained in:
psp 2023-08-16 11:19:21 +00:00
parent 1db21ade62
commit 0f0dc4b46c
7 changed files with 57 additions and 52 deletions

View File

@ -28,6 +28,8 @@ import jd.parser.html.Form;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterException;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DecrypterRetryException;
import jd.plugins.DecrypterRetryException.RetryReason;
import jd.plugins.DownloadLink;
import jd.plugins.FilePackage;
import jd.plugins.LinkStatus;
@ -53,12 +55,15 @@ public class AbloadDeGallery extends PluginForDecrypt {
final String addedurl = param.getCryptedUrl();
br.setFollowRedirects(true);
br.getPage(addedurl);
if (br.containsHTML("Ein Bild mit diesem Dateinamen existiert nicht\\.") || br.containsHTML(">Dieses Bild wurde gelöscht")) {
if (br.getHttpConnection().getResponseCode() == 404) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
} else if (br.containsHTML("Galerie nicht gefunden\\.") || br.containsHTML("Gallery not found\\.")) {
}
if (br.containsHTML("(?i)Ein Bild mit diesem Dateinamen existiert nicht\\.") || br.containsHTML(">\\s*Dieses Bild wurde gelöscht")) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
} else if (br.getHttpConnection().getResponseCode() == 404) {
} else if (br.containsHTML("(?i)Galerie nicht gefunden\\.") || br.containsHTML("(?i)Gallery not found\\.")) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
} else if (br.containsHTML("(?i)>\\s*Die Galerie ist leer")) {
throw new DecrypterRetryException(RetryReason.EMPTY_FOLDER);
}
if (!addedurl.contains("browseGallery.php?gal=") && !addedurl.contains("image.php")) {
final String galID = new Regex(addedurl, "([A-Za-z0-9]+)$").getMatch(0);

View File

@ -164,7 +164,7 @@ public class Bunkr extends PluginForHost {
}
private String getContentURL(final DownloadLink link) {
final String url = link.getPluginPatternMatcher();
final String url = Encoding.htmlOnlyDecode(link.getPluginPatternMatcher());
final Regex singleFileRegex = new Regex(url, BunkrAlbum.TYPE_SINGLE_FILE);
final String hostFromAddedURLWithoutSubdomain = Browser.getHost(url, false);
if (singleFileRegex.patternFind()) {
@ -216,6 +216,7 @@ public class Bunkr extends PluginForHost {
}
final String lastCachedDirecturl = link.getStringProperty(PROPERTY_LAST_GRABBED_DIRECTURL);
final String lastUsedSingleFileURL = link.getStringProperty(PROPERTY_LAST_USED_SINGLE_FILE_URL);
Exception exceptionFromDirecturlCheck = null;
if (lastCachedDirecturl != null && lastUsedSingleFileURL != null) {
logger.info("Trying to re-use last cached directurl: " + lastCachedDirecturl);
br.getHeaders().put("Referer", lastUsedSingleFileURL);
@ -229,8 +230,12 @@ public class Bunkr extends PluginForHost {
}
handleConnectionErrors(br, con);
logger.info("Successfully re-used last cached directurl");
if (con.getCompleteContentLength() > 0) {
link.setVerifiedFileSize(con.getCompleteContentLength());
}
return AvailableStatus.TRUE;
} catch (final Exception e) {
exceptionFromDirecturlCheck = e;
logger.log(e);
logger.info("Failed to re-use last cached directurl");
try {
@ -294,6 +299,10 @@ public class Bunkr extends PluginForHost {
br.getPage(singleFileURL);
}
final String freshDirecturl = getDirecturlFromSingleFileAvailablecheck(link, br.getURL(), false);
/* Avoid trying again with the same directurl if we already know the result. */
if (StringUtils.equals(freshDirecturl, lastCachedDirecturl) && exceptionFromDirecturlCheck != null) {
throw exceptionFromDirecturlCheck;
}
br.getHeaders().put("Referer", singleFileURL); // Important!
if (isDownload) {
dl = jd.plugins.BrowserAdapter.openDownload(br, link, freshDirecturl, isResumeable(link, null), this.getMaxChunks(null));
@ -429,6 +438,7 @@ public class Bunkr extends PluginForHost {
public void handleFree(final DownloadLink link) throws Exception {
requestFileInformation(link, true);
if (this.dl == null) {
/* Developer mistake! */
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
/* Add a download slot */

View File

@ -233,7 +233,6 @@ public class ORFMediathek extends PluginForHost {
dl.setEstimatedDuration(hit.getDuration());
dl.startDownload();
} else if (dllink.startsWith("rtmp")) {
link.setProperty("FLVFIXER", true);
throw new PluginException(LinkStatus.ERROR_FATAL, "Unsupported protocol");
} else {
if (isSubtitle(link)) {

View File

@ -35,6 +35,8 @@ import jd.parser.Regex;
import jd.plugins.Account;
import jd.plugins.Account.AccountType;
import jd.plugins.AccountInfo;
import jd.plugins.AccountInvalidException;
import jd.plugins.AccountRequiredException;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
@ -61,6 +63,24 @@ public class PCloudCom extends PluginForHost {
return br;
}
@Override
public String getLinkID(final DownloadLink link) {
String id = null;
try {
final String fileid = getFID(link);
final String folderID = getFolderID(link);
if (fileid != null) {
id = folderID + "_" + fileid;
}
} catch (final Throwable e) {
}
if (id != null) {
return "pcloud://" + id;
} else {
return super.getLinkID(link);
}
}
@Override
public String getAGBLink() {
return "https://my.pcloud.com/#page=policies&tab=terms-of-service";
@ -153,7 +173,7 @@ public class PCloudCom extends PluginForHost {
}
private String getDownloadURL(final DownloadLink link, final Account account, final String account_auth, final boolean publicDownload) throws Exception {
final String code = getCODE(link);
final String code = getFolderID(link);
if (isCompleteFolder(link)) {
if (account_auth != null) {
br.getPage("https://" + getAPIDomain(link) + "/showpublink?code=" + code + "&auth=" + account_auth);
@ -355,7 +375,7 @@ public class PCloudCom extends PluginForHost {
}
boolean publicDownload = true;
if (STATUS_CODE_MAYBE_OWNER_ONLY == statusCode) {
final String code = getCODE(link);
final String code = getFolderID(link);
getAPISafe("https://" + getAPIDomain(link) + "/showpublink?code=" + code + "&auth=" + account_auth);
final String ownerisme = PluginJSonUtils.getJson(br, "ownerisme");
if (StringUtils.equals(ownerisme, "true")) {
@ -373,7 +393,7 @@ public class PCloudCom extends PluginForHost {
* not yet implemented for complete folder(zip)
*/
/* tofolderid --> 0 = root */
final String code = getCODE(link);
final String code = getFolderID(link);
final String fileid = getFID(link);
getAPISafe("https://" + getAPIDomain(link) + "/copypubfile?fileid=" + fileid + "&tofolderid=0&code=" + code + "&auth=" + account_auth);
final String new_fileid = PluginJSonUtils.getJsonValue(br, "fileid");
@ -445,8 +465,8 @@ public class PCloudCom extends PluginForHost {
return null;
}
private String getCODE(final DownloadLink dl) throws PluginException {
final String ret = dl.getStringProperty("plain_code", null);
private String getFolderID(final DownloadLink dl) throws PluginException {
final String ret = dl.getStringProperty("plain_code");
if (ret == null) {
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
} else {
@ -455,7 +475,7 @@ public class PCloudCom extends PluginForHost {
}
private String getFID(final DownloadLink dl) throws PluginException {
final String ret = dl.getStringProperty("plain_fileid", null);
final String ret = dl.getStringProperty("plain_fileid");
if (ret == null) {
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
} else {
@ -484,20 +504,22 @@ public class PCloudCom extends PluginForHost {
case STATUS_CODE_OKAY:
/* Everything ok */
break;
case 1029:
throw new AccountRequiredException();
case STATUS_CODE_INVALID_LOGIN:
if ("de".equalsIgnoreCase(System.getProperty("user.language"))) {
statusMessage = "\r\nUngültiger Benutzername oder ungültiges Passwort!\r\nDu bist dir sicher, dass dein eingegebener Benutzername und Passwort stimmen? Versuche folgendes:\r\n1. Falls dein Passwort Sonderzeichen enthält, ändere es (entferne diese) und versuche es erneut!\r\n2. Gib deine Zugangsdaten per Hand (ohne kopieren/einfügen) ein.";
} else {
statusMessage = "\r\nInvalid username/password!\r\nYou're sure that the username and password you entered are correct? Some hints:\r\n1. If your password contains special characters, change it (remove them) and try again!\r\n2. Type in your username/password by hand without copy & paste.";
}
throw new PluginException(LinkStatus.ERROR_PREMIUM, statusMessage, PluginException.VALUE_ID_PREMIUM_DISABLE);
throw new AccountInvalidException(statusMessage);
case 2008:
if ("de".equalsIgnoreCase(System.getProperty("user.language"))) {
statusMessage = "\r\nDein Account hat keinen freien Speicherplatz mehr!";
} else {
statusMessage = "\r\nYour account has no free space anymore!";
}
throw new PluginException(LinkStatus.ERROR_PREMIUM, statusMessage, PluginException.VALUE_ID_PREMIUM_DISABLE);
throw new AccountInvalidException(statusMessage);
case STATUS_CODE_WRONG_LOCATION:
// wrong location
/*
@ -510,11 +532,11 @@ public class PCloudCom extends PluginForHost {
case 7002:
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
case STATUS_CODE_PREMIUMONLY:
throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_ONLY);
throw new AccountRequiredException();
case STATUS_CODE_MAYBE_OWNER_ONLY:
/* file might be set to preview only download */
/* "error": "Access denied. You do not have permissions to perform this operation." */
throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_ONLY);
throw new AccountRequiredException();
case 7014:
/*
* 2016-08-31: Added support for this though I'm not sure about this - I guess some kind of account traffic limit has been

View File

@ -1571,6 +1571,7 @@ public class PornHubCom extends PluginForHost {
public static Browser prepBr(final Browser br) {
if (TRY_MP4.get() && MP4_WORKAROUND.get()) {
/* 2023-08-16: This doesn't work anymore! */
br.setCookie("http://pornhub.com/", "platform", "mac");
br.getHeaders().put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15");
}

View File

@ -1,30 +0,0 @@
package org.jdownloader.settings;
import org.appwork.storage.config.ConfigInterface;
import org.appwork.storage.config.annotations.AboutConfig;
import org.appwork.storage.config.annotations.DefaultBooleanValue;
import org.appwork.storage.config.annotations.DescriptionForConfigEntry;
public interface RtmpdumpSettings extends ConfigInterface {
@AboutConfig
@DefaultBooleanValue(false)
@DescriptionForConfigEntry("Enable rtmpdump debug mode")
boolean isRtmpDumpDebugModeEnabled();
@AboutConfig
@DefaultBooleanValue(false)
@DescriptionForConfigEntry("Enable flvfixer debug mode. Beware, log file can be rather large!")
boolean isFlvFixerDebugModeEnabled();
void setRtmpDumpDebugModeEnabled(boolean b);
void setFlvFixerDebugModeEnabled(boolean b);
@AboutConfig
@DefaultBooleanValue(false)
boolean isWindowsPathWorkaroundEnabled();
void setWindowsPathWorkaroundEnabled(boolean b);
}

View File

@ -5,11 +5,6 @@ import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import jd.controlling.downloadcontroller.DownloadControllerConfig;
import jd.controlling.faviconcontroller.FavIconsConfig;
import jd.controlling.linkchecker.LinkCheckerConfig;
import jd.controlling.linkcrawler.LinkCrawlerConfig;
import org.appwork.storage.config.ConfigInterface;
import org.appwork.storage.config.JsonConfig;
import org.appwork.storage.config.annotations.AboutConfig;
@ -33,7 +28,6 @@ import org.jdownloader.plugins.controller.crawler.LazyCrawlerPlugin;
import org.jdownloader.plugins.controller.host.HostPluginController;
import org.jdownloader.plugins.controller.host.LazyHostPlugin;
import org.jdownloader.settings.AccountSettings;
import org.jdownloader.settings.RtmpdumpSettings;
import org.jdownloader.settings.SoundSettings;
import org.jdownloader.settings.staticreferences.CFG_API;
import org.jdownloader.settings.staticreferences.CFG_CAPTCHA;
@ -51,6 +45,11 @@ import org.jdownloader.updatev2.LastChanceSettings;
import org.jdownloader.updatev2.UpdateSettings;
import org.jdownloader.updatev2.gui.LAFOptions;
import jd.controlling.downloadcontroller.DownloadControllerConfig;
import jd.controlling.faviconcontroller.FavIconsConfig;
import jd.controlling.linkchecker.LinkCheckerConfig;
import jd.controlling.linkcrawler.LinkCrawlerConfig;
public class AdvancedConfigManager {
private static final AdvancedConfigManager INSTANCE = new AdvancedConfigManager();
@ -85,7 +84,6 @@ public class AdvancedConfigManager {
register(JsonConfig.create(FFmpegSetup.class));
register(JsonConfig.create(LogConfig.class));
register(JsonConfig.create(ShortcutSettings.class));
register(JsonConfig.create(RtmpdumpSettings.class));
register(JsonConfig.create(UpdateSettings.class));
register(JsonConfig.create(LastChanceSettings.class));
register(JsonConfig.create(ExtFileSystemViewSettings.class));