mirroring bot - 2025/06/12
This commit is contained in:
parent
abaff3cfb8
commit
d3e719fbf6
@ -74,7 +74,7 @@ import jd.plugins.components.PluginJSonUtils;
|
||||
import jd.plugins.download.HashInfo;
|
||||
import jd.plugins.hoster.ArchiveOrg;
|
||||
|
||||
@DecrypterPlugin(revision = "$Revision: 50955 $", interfaceVersion = 2, names = { "archive.org", "subdomain.archive.org" }, urls = { "https?://(?:www\\.)?archive\\.org/((?:details|download|stream|embed)/.+|search\\?query=.+)", "https?://[^/]+\\.archive\\.org/view_archive\\.php\\?archive=[^\\&]+(?:\\&file=[^\\&]+)?" })
|
||||
@DecrypterPlugin(revision = "$Revision: 51141 $", interfaceVersion = 2, names = { "archive.org", "subdomain.archive.org" }, urls = { "https?://(?:www\\.)?archive\\.org/((?:details|download|stream|embed)/.+|search\\?query=.+)", "https?://[^/]+\\.archive\\.org/view_archive\\.php\\?archive=[^\\&]+(?:\\&file=[^\\&]+)?" })
|
||||
public class ArchiveOrgCrawler extends PluginForDecrypt {
|
||||
public ArchiveOrgCrawler(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
@ -596,6 +596,7 @@ public class ArchiveOrgCrawler extends PluginForDecrypt {
|
||||
|
||||
public ArrayList<DownloadLink> crawlBook(final Browser br, final String ajaxurl, final Account account) throws Exception {
|
||||
if (StringUtils.isEmpty(ajaxurl)) {
|
||||
/* Developer mistake */
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
final String identifier = UrlQuery.parse(ajaxurl).get("id");
|
||||
@ -735,7 +736,12 @@ public class ArchiveOrgCrawler extends PluginForDecrypt {
|
||||
result.setProperty(ArchiveOrg.PROPERTY_BOOK_PAGE_MAX, internalPageIndex);
|
||||
final int thispage = result.getIntegerProperty(ArchiveOrg.PROPERTY_BOOK_PAGE_INTERNAL_INDEX, 0);
|
||||
/* Set filename */
|
||||
result.setFinalFileName(StringUtils.formatByPadLength(padLength, thispage) + "_" + title + ".jpg");
|
||||
if (result.isAvailable()) {
|
||||
result.setFinalFileName(StringUtils.formatByPadLength(padLength, thispage) + "_" + title + ".jpg");
|
||||
} else {
|
||||
result.setFinalFileName(StringUtils.formatByPadLength(padLength, thispage) + "_ADD_ACCOUNT_AND_RE_CRAWL_TO_DOWNLOAD_" + title + ".jpg");
|
||||
result.setComment("Archive.org Account required to be able to download this book page. Add an archive.org account to JDownloader, then delete and re-add the link to this book to be able to download all book pages.");
|
||||
}
|
||||
/* Assign FilePackage to item so all results of this run get placed into one package. */
|
||||
result._setFilePackage(fp);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ import jd.plugins.PluginForDecrypt;
|
||||
import jd.plugins.PluginForHost;
|
||||
import jd.plugins.components.SiteType.SiteTemplate;
|
||||
|
||||
@DecrypterPlugin(revision = "$Revision: 51127 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@DecrypterPlugin(revision = "$Revision: 51140 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class GenericYetiShareFolder extends PluginForDecrypt {
|
||||
public GenericYetiShareFolder(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
@ -97,6 +97,7 @@ public class GenericYetiShareFolder extends PluginForDecrypt {
|
||||
ret.add(new String[] { "anonsharing.com" });
|
||||
ret.add(new String[] { "loadedfiles.org" });
|
||||
ret.add(new String[] { "drive.sgpedia.com" });
|
||||
ret.add(new String[] { "imgcubby.com" });
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
165
svn_trunk/src/jd/plugins/decrypter/PimpandhostComAlbum.java
Normal file
165
svn_trunk/src/jd/plugins/decrypter/PimpandhostComAlbum.java
Normal file
@ -0,0 +1,165 @@
|
||||
//jDownloader - Downloadmanager
|
||||
//Copyright (C) 2009 JD-Team support@jdownloader.org
|
||||
//
|
||||
//This program is free software: you can redistribute it and/or modify
|
||||
//it under the terms of the GNU General Public License as published by
|
||||
//the Free Software Foundation, either version 3 of the License, or
|
||||
//(at your option) any later version.
|
||||
//
|
||||
//This program is distributed in the hope that it will be useful,
|
||||
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
//GNU General Public License for more details.
|
||||
//
|
||||
//You should have received a copy of the GNU General Public License
|
||||
//along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package jd.plugins.decrypter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.controlling.ProgressController;
|
||||
import jd.http.Browser;
|
||||
import jd.nutils.encoding.Encoding;
|
||||
import jd.parser.Regex;
|
||||
import jd.plugins.Account;
|
||||
import jd.plugins.CryptedLink;
|
||||
import jd.plugins.DecrypterPlugin;
|
||||
import jd.plugins.DownloadLink;
|
||||
import jd.plugins.FilePackage;
|
||||
import jd.plugins.LinkStatus;
|
||||
import jd.plugins.PluginDependencies;
|
||||
import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForDecrypt;
|
||||
import jd.plugins.hoster.PimpandhostCom;
|
||||
|
||||
@DecrypterPlugin(revision = "$Revision: 51139 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@PluginDependencies(dependencies = { PimpandhostCom.class })
|
||||
public class PimpandhostComAlbum extends PluginForDecrypt {
|
||||
public PimpandhostComAlbum(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Browser createNewBrowserInstance() {
|
||||
final Browser br = super.createNewBrowserInstance();
|
||||
br.setFollowRedirects(true);
|
||||
return br;
|
||||
}
|
||||
|
||||
public static List<String[]> getPluginDomains() {
|
||||
return PimpandhostCom.getPluginDomains();
|
||||
}
|
||||
|
||||
public static String[] getAnnotationNames() {
|
||||
return buildAnnotationNames(getPluginDomains());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] siteSupportedNames() {
|
||||
return buildSupportedNames(getPluginDomains());
|
||||
}
|
||||
|
||||
public static String[] getAnnotationUrls() {
|
||||
return buildAnnotationUrls(getPluginDomains());
|
||||
}
|
||||
|
||||
public static String[] buildAnnotationUrls(final List<String[]> pluginDomains) {
|
||||
final List<String> ret = new ArrayList<String>();
|
||||
for (final String[] domains : pluginDomains) {
|
||||
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "/album/(\\d+)");
|
||||
}
|
||||
return ret.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressController progress) throws Exception {
|
||||
final ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
|
||||
final String contenturl = param.getCryptedUrl();
|
||||
final int max_items_per_page = 100; // Website: 16
|
||||
int page = 1;
|
||||
final HashSet<String> dupes = new HashSet<String>();
|
||||
FilePackage fp = null;
|
||||
pagination: do {
|
||||
br.getPage(contenturl + "?page=" + page + "&per-page=" + max_items_per_page);
|
||||
if (br.getHttpConnection().getResponseCode() == 404) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML(">\\s*Album not found")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
int numberofNewItemsThisPage = 0;
|
||||
final String album_id = new Regex(param.getCryptedUrl(), this.getSupportedLinks()).getMatch(0);
|
||||
final String[] filenames = br.getRegex("data-filename=\"([^\"]+)").getColumn(0);
|
||||
/* Filesizes in bytes */
|
||||
final String[] filesizes = br.getRegex("data-filename=[^>]*data-size=\"(\\d+)").getColumn(0);
|
||||
final String[] links = br.getRegex("(/image/\\d+)\"").getColumn(0);
|
||||
if (links == null || links.length == 0) {
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
final List<String> urlsWithoutDupes = new ArrayList<String>();
|
||||
for (final String url : links) {
|
||||
if (!dupes.add(url)) {
|
||||
continue;
|
||||
}
|
||||
urlsWithoutDupes.add(url);
|
||||
dupes.add(url);
|
||||
numberofNewItemsThisPage++;
|
||||
}
|
||||
if (numberofNewItemsThisPage == 0) {
|
||||
logger.info("Stopping because: Failed to find any new items on current page");
|
||||
break;
|
||||
}
|
||||
if (fp == null) {
|
||||
String album_title = br.getRegex("album-name\"[^>]*>\\s*<span>([^<]+)</span>").getMatch(0);
|
||||
fp = FilePackage.getInstance();
|
||||
if (album_title != null) {
|
||||
fp.setName(Encoding.htmlDecode(album_title).trim());
|
||||
} else {
|
||||
fp.setName(album_id);
|
||||
}
|
||||
fp.setPackageKey(getHost() + "://album/" + album_id);
|
||||
}
|
||||
int index = 0;
|
||||
for (String url : urlsWithoutDupes) {
|
||||
url = br.getURL(url).toExternalForm();
|
||||
final DownloadLink image = createDownloadlink(url);
|
||||
if (filenames != null && filenames.length == urlsWithoutDupes.size()) {
|
||||
String filename = filenames[index];
|
||||
filename = Encoding.htmlDecode(filename).trim();
|
||||
image.setName(filename);
|
||||
} else {
|
||||
logger.warning("Failed to find filename");
|
||||
/* Fallback */
|
||||
image.setName(url + ".jpg");
|
||||
}
|
||||
if (filesizes != null && filesizes.length == urlsWithoutDupes.size()) {
|
||||
final String filesizeBytes = filesizes[index];
|
||||
image.setVerifiedFileSize(Long.parseLong(filesizeBytes));
|
||||
} else {
|
||||
logger.warning("Failed to find filesize");
|
||||
}
|
||||
image.setAvailable(true);
|
||||
image._setFilePackage(fp);
|
||||
ret.add(image);
|
||||
distribute(image);
|
||||
index++;
|
||||
}
|
||||
logger.info("Crawled page " + page + " | New items this page: " + numberofNewItemsThisPage + " | Total so far: " + ret.size());
|
||||
if (numberofNewItemsThisPage < max_items_per_page) {
|
||||
logger.info("Stopping because: Looks like we've reached the end");
|
||||
break pagination;
|
||||
}
|
||||
page++;
|
||||
} while (!this.isAbort());
|
||||
if (ret.isEmpty()) {
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCaptcha(CryptedLink link, Account acc) {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ import jd.plugins.PluginException;
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.jdownloader.plugins.components.XFileSharingProBasic;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 51134 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@HostPlugin(revision = "$Revision: 51136 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class ClicknuploadOrg extends XFileSharingProBasic {
|
||||
public ClicknuploadOrg(final PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
@ -50,7 +50,7 @@ public class ClicknuploadOrg extends XFileSharingProBasic {
|
||||
public static List<String[]> getPluginDomains() {
|
||||
final List<String[]> ret = new ArrayList<String[]>();
|
||||
// each entry in List<String[]> will result in one PluginForHost, Plugin.getHost() will return String[0]->main domain
|
||||
ret.add(new String[] { "clicknupload.click", "clicknupload.link", "clicknupload.red", "clicknupload.to", "clicknupload.cc", "clicknupload.co", "clicknupload.org", "clicknupload.com", "clicknupload.me", "clicknupload.club", "clicknupload.online", "clicknupload.download", "clicknupload.vip", "clicknupload.site", "clicknupload.xyz", "clicknupload.one", "clicknupload.name", "clicknupload.space", "clickndownload.org", "clickndownload.space", "clickndownload.click", "clickndownload.link", "clickndownload.site", "clickndownload.online", "clicknupload.cfd", "clickndownload.cloud" });
|
||||
ret.add(new String[] { "clicknupload.click", "clicknupload.link", "clicknupload.red", "clicknupload.to", "clicknupload.cc", "clicknupload.co", "clicknupload.org", "clicknupload.com", "clicknupload.me", "clicknupload.club", "clicknupload.online", "clicknupload.download", "clicknupload.vip", "clicknupload.site", "clicknupload.xyz", "clicknupload.one", "clicknupload.name", "clicknupload.space", "clickndownload.org", "clickndownload.space", "clickndownload.click", "clickndownload.link", "clickndownload.site", "clickndownload.online", "clicknupload.cfd", "clickndownload.cloud", "clickndownload.cfd" });
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -52,11 +52,11 @@ import jd.plugins.LinkStatus;
|
||||
import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForHost;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 49412 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@HostPlugin(revision = "$Revision: 51140 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class FikperCom extends PluginForHost {
|
||||
public FikperCom(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
this.enablePremium("https://fikper.com/register");
|
||||
this.enablePremium("https://" + getHost() + "/register");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,7 +66,7 @@ public class FikperCom extends PluginForHost {
|
||||
|
||||
@Override
|
||||
public String getAGBLink() {
|
||||
return "https://fikper.com/terms-of-use";
|
||||
return "https://" + getHost() + "/terms-of-use";
|
||||
}
|
||||
|
||||
private static List<String[]> getPluginDomains() {
|
||||
|
@ -19,6 +19,13 @@ import java.util.Locale;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.appwork.utils.formatter.SizeFormatter;
|
||||
import org.appwork.utils.formatter.TimeFormatter;
|
||||
import org.jdownloader.plugins.components.config.FilestoreToConfig;
|
||||
import org.jdownloader.plugins.config.PluginJsonConfig;
|
||||
import org.jdownloader.plugins.controller.LazyPlugin;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.http.Browser;
|
||||
import jd.http.Cookies;
|
||||
@ -39,14 +46,7 @@ import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForHost;
|
||||
import jd.plugins.components.UserAgents;
|
||||
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.appwork.utils.formatter.SizeFormatter;
|
||||
import org.appwork.utils.formatter.TimeFormatter;
|
||||
import org.jdownloader.plugins.components.config.FilestoreToConfig;
|
||||
import org.jdownloader.plugins.config.PluginJsonConfig;
|
||||
import org.jdownloader.plugins.controller.LazyPlugin;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 51036 $", interfaceVersion = 2, names = { "filestore.to" }, urls = { "https?://(?:www\\.)?filestore\\.to/\\?d=([A-Z0-9]+)" })
|
||||
@HostPlugin(revision = "$Revision: 51141 $", interfaceVersion = 2, names = { "filestore.to" }, urls = { "https?://(?:www\\.)?filestore\\.to/\\?d=([A-Z0-9]+)" })
|
||||
public class FilestoreTo extends PluginForHost {
|
||||
public FilestoreTo(final PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
@ -168,34 +168,40 @@ public class FilestoreTo extends PluginForHost {
|
||||
}
|
||||
|
||||
private void checkErrors(final DownloadLink link) throws PluginException {
|
||||
if (br.containsHTML("(?i)Derzeit haben wir leider keinen freien Downloadslots frei\\. Bitte nochmal versuchen\\.")) {
|
||||
if (br.containsHTML("Derzeit haben wir leider keinen freien Downloadslots frei\\. Bitte nochmal versuchen\\.")) {
|
||||
errorNoFreeSlots();
|
||||
} else if (br.containsHTML("(?i)>\\s*Leider sind aktuell keine freien Downloadslots")) {
|
||||
/* This code should never be reached */
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
} else if (br.containsHTML(">\\s*Leider sind aktuell keine freien Downloadslots")) {
|
||||
errorNoFreeSlots();
|
||||
/* This code should never be reached */
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
} else if (br.getURL().contains("/error/limit")) {
|
||||
throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, "Wait before starting new downloads", 5 * 60 * 1000l);
|
||||
} else if (br.containsHTML("(?i)>\\s*Datei nicht gefunden")) {
|
||||
} else if (br.containsHTML(">\\s*Datei nicht gefunden")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML("(?i)>\\s*DIE DATEI EXISTIERT LEIDER NICHT MEHR")) {
|
||||
} else if (br.containsHTML(">\\s*DIE DATEI EXISTIERT LEIDER NICHT MEHR")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML("(?i)>\\s*Datei gesperrt")) {
|
||||
} else if (br.containsHTML(">\\s*Datei gesperrt")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML("(?i)Entweder wurde die Datei von unseren Servern entfernt oder der Download-Link war")) {
|
||||
} else if (br.containsHTML("Entweder wurde die Datei von unseren Servern entfernt oder der Download-Link war")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML("(?i)>\\s*Für diese Datei ist eine Take Down-Meldung eingegangen")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML("(?i)Derzeit haben wir Serverprobleme und arbeiten daran\\. Bitte nochmal versuchen\\.")) {
|
||||
} else if (br.containsHTML(">\\s*Für diese Datei ist eine Take Down-Meldung eingegangen")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND, "File abused");
|
||||
} else if (br.containsHTML("Derzeit haben wir Serverprobleme und arbeiten daran\\. Bitte nochmal versuchen\\.")) {
|
||||
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server issues", 15 * 60 * 1000l);
|
||||
} else if (br.containsHTML(">\\s*Ihr Download ist vorübergehend aufgrund des Verdachtes der")) {
|
||||
throw new AccountUnavailableException("Account blocked due to suspicion of account sharing", 30 * 60 * 1000);
|
||||
} else if (br.containsHTML("(?i)>\\s*503 - Service Temporarily Unavailable\\s*<")) {
|
||||
} else if (br.containsHTML(">\\s*Es steht aktuell kein Server zum Download zur Verfügung")) {
|
||||
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Es steht aktuell kein Server zum Download zur Verfügung. Bitte versuche es später erneut!", 10 * 60 * 1000l);
|
||||
} else if (br.containsHTML(">\\s*503 - Service Temporarily Unavailable\\s*<")) {
|
||||
/* Goes along with correct header responsecode 503 */
|
||||
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 503", 5 * 60 * 1000l);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleDownload(final DownloadLink link, final Account account, final boolean resume, int maxChunks) throws Exception {
|
||||
final String errorMsg = br.getRegex("class=\"alert alert-danger page-alert mb-2\">\\s*<strong>([^<>]+)</strong>").getMatch(0);
|
||||
String errorMsg = br.getRegex("class=\"alert alert-danger page-alert mb-2\"[^>]*>\\s*<strong>Download-Fehler</strong>\\s*<br>([^<]+)<").getMatch(0);
|
||||
if (errorMsg == null) {
|
||||
errorMsg = br.getRegex("class=\"alert alert-danger page-alert mb-2\">\\s*<strong>([^>]+)</strong>").getMatch(0);
|
||||
}
|
||||
if (errorMsg != null) {
|
||||
if (errorMsg.matches("(?i)Datei noch nicht bereit")) {
|
||||
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, errorMsg, 5 * 60 * 1000l);
|
||||
@ -204,13 +210,16 @@ public class FilestoreTo extends PluginForHost {
|
||||
throw new PluginException(LinkStatus.ERROR_FATAL, errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleDownload(final DownloadLink link, final Account account, final boolean resume, int maxChunks) throws Exception {
|
||||
// form 1
|
||||
Form dlform = br.getFormByRegex("(?i)>\\s*Download\\s*</button>");
|
||||
Form dlform = br.getFormByRegex(">\\s*Download\\s*</button>");
|
||||
if (dlform != null) {
|
||||
br.submitForm(dlform);
|
||||
}
|
||||
// form 2
|
||||
dlform = br.getFormByRegex("(?i)>\\s*Download starten\\s*</button>");
|
||||
dlform = br.getFormByRegex(">\\s*Download starten\\s*</button>");
|
||||
if (dlform != null) {
|
||||
// not enforced
|
||||
if (account == null || AccountType.FREE.equals(account.getType())) {
|
||||
@ -223,14 +232,17 @@ public class FilestoreTo extends PluginForHost {
|
||||
}
|
||||
br.submitForm(dlform);
|
||||
}
|
||||
String dllink = getDllink(br);
|
||||
String dllink = br.getRegex("<a href\\s*=\\s*(\"|')([^>]*)\\1>hier</a>").getMatch(1);
|
||||
if (dllink == null) {
|
||||
dllink = br.getRegex("<iframe class\\s*=\\s*\"downframe\" src\\s*=\\s*\"(.*?)\"").getMatch(0);
|
||||
}
|
||||
if (StringUtils.isEmpty(dllink)) {
|
||||
checkErrors(link);
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
if ((account == null || account.getType() == AccountType.PREMIUM) && PluginJsonConfig.get(FilestoreToConfig.class).isModifyFinalDownloadurls()) {
|
||||
/* See: https://board.jdownloader.org/showthread.php?t=91192 */
|
||||
dllink = dllink.replaceFirst("/free/", "/premium/");
|
||||
dllink = dllink.replaceFirst("(?i)/free/", "/premium/");
|
||||
}
|
||||
if (!resume) {
|
||||
maxChunks = 1;
|
||||
@ -384,15 +396,6 @@ public class FilestoreTo extends PluginForHost {
|
||||
}
|
||||
}
|
||||
|
||||
/** Finds direct downloadable URL inside HTML code. */
|
||||
private String getDllink(final Browser br) {
|
||||
String dllink = br.getRegex("<a href\\s*=\\s*(\"|')([^>]*)\\1>hier</a>").getMatch(1);
|
||||
if (dllink == null) {
|
||||
dllink = br.getRegex("<iframe class\\s*=\\s*\"downframe\" src\\s*=\\s*\"(.*?)\"").getMatch(0);
|
||||
}
|
||||
return dllink;
|
||||
}
|
||||
|
||||
// private Browser prepAjax(Browser prepBr) {
|
||||
// prepBr.getHeaders().put("Accept", "*/*");
|
||||
// prepBr.getHeaders().put("Accept-Charset", null);
|
||||
|
104
svn_trunk/src/jd/plugins/hoster/ImgcubbyCom.java
Normal file
104
svn_trunk/src/jd/plugins/hoster/ImgcubbyCom.java
Normal file
@ -0,0 +1,104 @@
|
||||
//jDownloader - Downloadmanager
|
||||
//Copyright (C) 2016 JD-Team support@jdownloader.org
|
||||
//
|
||||
//This program is free software: you can redistribute it and/or modify
|
||||
//it under the terms of the GNU General Public License as published by
|
||||
//the Free Software Foundation, either version 3 of the License, or
|
||||
//(at your option) any later version.
|
||||
//
|
||||
//This program is distributed in the hope that it will be useful,
|
||||
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
//GNU General Public License for more details.
|
||||
//
|
||||
//You should have received a copy of the GNU General Public License
|
||||
//along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package jd.plugins.hoster;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdownloader.plugins.components.YetiShareCore;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.plugins.Account;
|
||||
import jd.plugins.Account.AccountType;
|
||||
import jd.plugins.DownloadLink;
|
||||
import jd.plugins.HostPlugin;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 51140 $", interfaceVersion = 2, names = {}, urls = {})
|
||||
public class ImgcubbyCom extends YetiShareCore {
|
||||
public ImgcubbyCom(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
this.enablePremium(getPurchasePremiumURL());
|
||||
}
|
||||
|
||||
/**
|
||||
* DEV NOTES YetiShare<br />
|
||||
****************************
|
||||
* mods: See overridden functions<br />
|
||||
* limit-info:<br />
|
||||
* captchatype-info: null, reCaptchaV2, hcaptcha<br />
|
||||
* other: <br />
|
||||
*/
|
||||
public static List<String[]> getPluginDomains() {
|
||||
final List<String[]> ret = new ArrayList<String[]>();
|
||||
// each entry in List<String[]> will result in one PluginForHost, Plugin.getHost() will return String[0]->main domain
|
||||
ret.add(new String[] { "imgcubby.com" });
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static String[] getAnnotationNames() {
|
||||
return buildAnnotationNames(getPluginDomains());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] siteSupportedNames() {
|
||||
return buildSupportedNames(getPluginDomains());
|
||||
}
|
||||
|
||||
public static String[] getAnnotationUrls() {
|
||||
return YetiShareCore.buildAnnotationUrls(getPluginDomains());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isResumeable(final DownloadLink link, final Account account) {
|
||||
if (account != null && account.getType() == AccountType.FREE) {
|
||||
/* Free Account */
|
||||
return true;
|
||||
} else if (account != null && account.getType() == AccountType.PREMIUM) {
|
||||
/* Premium account */
|
||||
return true;
|
||||
} else {
|
||||
/* Free(anonymous) and unknown account type */
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxChunks(final Account account) {
|
||||
if (account != null && account.getType() == AccountType.FREE) {
|
||||
/* Free Account */
|
||||
return 0;
|
||||
} else if (account != null && account.getType() == AccountType.PREMIUM) {
|
||||
/* Premium account */
|
||||
return 0;
|
||||
} else {
|
||||
/* Free(anonymous) and unknown account type */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSimultanFreeDownloadNum() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int getMaxSimultaneousFreeAccountDownloads() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSimultanPremiumDownloadNum() {
|
||||
return -1;
|
||||
}
|
||||
}
|
@ -21,12 +21,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.appwork.storage.TypeRef;
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.jdownloader.captcha.v2.challenge.recaptcha.v2.CaptchaHelperHostPluginRecaptchaV2;
|
||||
import org.jdownloader.gui.translate._GUI;
|
||||
import org.jdownloader.plugins.controller.LazyPlugin;
|
||||
|
||||
import com.formdev.flatlaf.util.StringUtils;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.http.Browser;
|
||||
import jd.http.Cookies;
|
||||
@ -46,7 +45,7 @@ import jd.plugins.LinkStatus;
|
||||
import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForHost;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 51101 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@HostPlugin(revision = "$Revision: 51137 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class ManyvidsCom extends PluginForHost {
|
||||
public ManyvidsCom(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
|
@ -18,14 +18,16 @@ package jd.plugins.hoster;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.appwork.utils.formatter.SizeFormatter;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.http.Browser;
|
||||
import jd.nutils.encoding.Encoding;
|
||||
import jd.parser.Regex;
|
||||
import jd.parser.html.Form;
|
||||
import jd.plugins.Account;
|
||||
import jd.plugins.DownloadLink;
|
||||
import jd.plugins.DownloadLink.AvailableStatus;
|
||||
import jd.plugins.HostPlugin;
|
||||
@ -33,7 +35,7 @@ import jd.plugins.LinkStatus;
|
||||
import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForHost;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 51131 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@HostPlugin(revision = "$Revision: 51139 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class MegawrzutaPl extends PluginForHost {
|
||||
public MegawrzutaPl(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
@ -43,6 +45,7 @@ public class MegawrzutaPl extends PluginForHost {
|
||||
public Browser createNewBrowserInstance() {
|
||||
final Browser br = super.createNewBrowserInstance();
|
||||
br.setFollowRedirects(true);
|
||||
br.setCookie(getHost(), "popupConsent1", "true");
|
||||
return br;
|
||||
}
|
||||
|
||||
@ -67,17 +70,25 @@ public class MegawrzutaPl extends PluginForHost {
|
||||
return buildSupportedNames(getPluginDomains());
|
||||
}
|
||||
|
||||
private static final Pattern PATTERN_NORMAL = Pattern.compile("/download/([a-f0-9]{32})\\.html", Pattern.CASE_INSENSITIVE);
|
||||
private static final Pattern PATTERN_SHORT = Pattern.compile("/(?:[a-z]{2}/)?([a-z0-9]{8,})", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
public static String[] getAnnotationUrls() {
|
||||
final List<String> ret = new ArrayList<String>();
|
||||
for (final String[] domains : getPluginDomains()) {
|
||||
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "/download/([a-f0-9]{32})\\.html");
|
||||
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "(" + PATTERN_NORMAL.pattern() + "|" + PATTERN_SHORT.pattern() + ")");
|
||||
}
|
||||
return ret.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/* Connection stuff */
|
||||
private final boolean FREE_RESUME = false;
|
||||
private final int FREE_MAXCHUNKS = 1;
|
||||
@Override
|
||||
public boolean isResumeable(final DownloadLink link, final Account account) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getMaxChunks(final DownloadLink link, final Account account) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLinkID(final DownloadLink link) {
|
||||
@ -90,14 +101,20 @@ public class MegawrzutaPl extends PluginForHost {
|
||||
}
|
||||
|
||||
private String getFID(final DownloadLink link) {
|
||||
return new Regex(link.getPluginPatternMatcher(), this.getSupportedLinks()).getMatch(0);
|
||||
String fid = new Regex(link.getPluginPatternMatcher(), PATTERN_NORMAL).getMatch(0);
|
||||
if (fid != null) {
|
||||
return fid;
|
||||
}
|
||||
fid = new Regex(link.getPluginPatternMatcher(), PATTERN_SHORT).getMatch(0);
|
||||
return fid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvailableStatus requestFileInformation(final DownloadLink link) throws IOException, PluginException {
|
||||
this.setBrowserExclusive();
|
||||
final String fid = this.getFID(link);
|
||||
if (!link.isNameSet()) {
|
||||
link.setName(this.getFID(link));
|
||||
link.setName(fid);
|
||||
}
|
||||
br.getPage(link.getPluginPatternMatcher());
|
||||
if (this.br.getHttpConnection().getResponseCode() == 404) {
|
||||
@ -108,16 +125,49 @@ public class MegawrzutaPl extends PluginForHost {
|
||||
/* "Upload expired" */
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
final Regex finfo = br.getRegex("<h3>([^<>\"]+)<h5>([^<>\"]+)<");
|
||||
String filename = finfo.getMatch(0);
|
||||
String filesize = finfo.getMatch(1);
|
||||
if (filename != null) {
|
||||
link.setName(Encoding.htmlDecode(filename).trim());
|
||||
} else {
|
||||
logger.warning("Failed to find filename");
|
||||
int numberofFiles = 1;
|
||||
final String numberofFilesStr = br.getRegex("<span>(\\d+)</span>\\s*pliki").getMatch(0);
|
||||
if (numberofFilesStr != null) {
|
||||
numberofFiles = Integer.parseInt(numberofFilesStr);
|
||||
if (numberofFiles == 0) {
|
||||
/* Not sure if this can happen */
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND, "Empty folder");
|
||||
}
|
||||
}
|
||||
if (!StringUtils.isEmpty(filesize)) {
|
||||
link.setDownloadSize(SizeFormatter.getSize(filesize));
|
||||
/* Folders can contain multiple files but user cannot download individual files, only if the folder contains only a single file. */
|
||||
final String[] filenames = br.getRegex("<span class=\"ml-2\"[^>]*>([^<]+)</span>").getColumn(0);
|
||||
String folder_title = br.getRegex("<h1 class=\"h3\">Pobierz - ([^<]+)</h1>").getMatch(0);
|
||||
if (folder_title != null) {
|
||||
folder_title = Encoding.htmlDecode(folder_title).trim();
|
||||
}
|
||||
if (numberofFiles == 1) {
|
||||
/* Single file -> Can have varying file extension */
|
||||
if (filenames != null && filenames.length > 0) {
|
||||
final String filename = Encoding.htmlDecode(filenames[0]).trim();
|
||||
link.setFinalFileName(filename);
|
||||
} else {
|
||||
logger.warning("Failed to find filename of single file");
|
||||
/* Fallback */
|
||||
if (folder_title != null) {
|
||||
link.setName(folder_title);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Multiple files -> Always .zip extension */
|
||||
if (folder_title != null) {
|
||||
link.setName(this.correctOrApplyFileNameExtension(folder_title, ".zip", null));
|
||||
} else {
|
||||
logger.warning("Failed to find folder title");
|
||||
/* Fallback */
|
||||
link.setName(fid + ".zip");
|
||||
}
|
||||
}
|
||||
final String[] filesizes = br.getRegex("<span class=\"text-muted\"[^>]*>(\\d+[^<]+)</span>").getColumn(0);
|
||||
if (filesizes != null && filesizes.length > 0) {
|
||||
/* First file size = Size of all files -> Total file size of folder */
|
||||
link.setDownloadSize(SizeFormatter.getSize(filesizes[0]));
|
||||
} else {
|
||||
logger.warning("Failed to find filesize");
|
||||
}
|
||||
return AvailableStatus.TRUE;
|
||||
}
|
||||
@ -125,25 +175,13 @@ public class MegawrzutaPl extends PluginForHost {
|
||||
@Override
|
||||
public void handleFree(final DownloadLink link) throws Exception, PluginException {
|
||||
requestFileInformation(link);
|
||||
doFree(link, FREE_RESUME, FREE_MAXCHUNKS, "free_directlink");
|
||||
}
|
||||
|
||||
private void doFree(final DownloadLink link, final boolean resumable, final int maxchunks, final String directlinkproperty) throws Exception, PluginException {
|
||||
String dllink = br.getRegex("class='download-button-wrapper text-center'>\\s*<a href=(?:'|\")(/files/[^<>\"']+)(?:'|\")").getMatch(0);
|
||||
if (StringUtils.isEmpty(dllink)) {
|
||||
final Form dlform = br.getForm(0);
|
||||
if (dlform == null) {
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
dl = jd.plugins.BrowserAdapter.openDownload(br, link, dllink, resumable, maxchunks);
|
||||
if (dl.getConnection().getContentType().contains("html")) {
|
||||
if (dl.getConnection().getResponseCode() == 403) {
|
||||
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 403", 60 * 60 * 1000l);
|
||||
} else if (dl.getConnection().getResponseCode() == 404) {
|
||||
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 404", 60 * 60 * 1000l);
|
||||
}
|
||||
br.followConnection();
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
link.setProperty(directlinkproperty, dl.getConnection().getURL().toExternalForm());
|
||||
dl = jd.plugins.BrowserAdapter.openDownload(br, link, dlform, this.isResumeable(link, null), this.getMaxChunks(link, null));
|
||||
this.handleConnectionErrors(br, dl.getConnection());
|
||||
// link.setProperty(directlinkproperty, dl.getConnection().getURL().toExternalForm());
|
||||
dl.startDownload();
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ import jd.plugins.PluginForHost;
|
||||
*
|
||||
* @author raztoki<br />
|
||||
*/
|
||||
@HostPlugin(revision = "$Revision: 51131 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@HostPlugin(revision = "$Revision: 51137 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class Offline extends PluginForHost {
|
||||
public static String getOfflineVersion() {
|
||||
final HostPlugin hostPlugin = Offline.class.getAnnotation(HostPlugin.class);
|
||||
@ -228,6 +228,7 @@ public class Offline extends PluginForHost {
|
||||
/* 2025-06-02: Domains that used to be in plugin "ImagemazeCom" END */
|
||||
ret.add(new String[] { "megafiles.io", "megafile.cc" });
|
||||
ret.add(new String[] { "istream.lol" });
|
||||
ret.add(new String[] { "micloudfiles.com" });
|
||||
if (cache != null) {
|
||||
cache.put(cacheID, ret);
|
||||
}
|
||||
|
@ -15,6 +15,14 @@
|
||||
//along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package jd.plugins.hoster;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.appwork.utils.formatter.SizeFormatter;
|
||||
import org.jdownloader.plugins.controller.LazyPlugin;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.http.Browser;
|
||||
import jd.nutils.encoding.Encoding;
|
||||
@ -27,16 +35,16 @@ import jd.plugins.LinkStatus;
|
||||
import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForHost;
|
||||
|
||||
import org.appwork.utils.StringUtils;
|
||||
import org.appwork.utils.formatter.SizeFormatter;
|
||||
import org.jdownloader.plugins.controller.LazyPlugin;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 49243 $", interfaceVersion = 3, names = { "pimpandhost.com" }, urls = { "https?://(?:www\\.)?pimpandhost\\.com/image/(\\d+)" })
|
||||
@HostPlugin(revision = "$Revision: 51138 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class PimpandhostCom extends PluginForHost {
|
||||
public PimpandhostCom(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
}
|
||||
|
||||
private static final Pattern PATTERN_NORMAL = Pattern.compile("/image/(\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
private static final Pattern PATTERN_OLD_1 = Pattern.compile("/image/show/id/(\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
private static final Pattern PATTERN_OLD_2 = Pattern.compile("/index\\.php/image/(\\d+)-[a-z]+\\.html", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
@Override
|
||||
public Browser createNewBrowserInstance() {
|
||||
final Browser br = super.createNewBrowserInstance();
|
||||
@ -48,14 +56,23 @@ public class PimpandhostCom extends PluginForHost {
|
||||
public String getLinkID(final DownloadLink link) {
|
||||
final String fid = getFID(link);
|
||||
if (fid != null) {
|
||||
return "pimpandhost_com://" + fid;
|
||||
return getHost() + "://" + fid;
|
||||
} else {
|
||||
return super.getLinkID(link);
|
||||
}
|
||||
}
|
||||
|
||||
private String getFID(final DownloadLink link) {
|
||||
return new Regex(link.getPluginPatternMatcher(), this.getSupportedLinks()).getMatch(0);
|
||||
String fid = new Regex(link.getPluginPatternMatcher(), PATTERN_NORMAL).getMatch(0);
|
||||
if (fid != null) {
|
||||
return fid;
|
||||
}
|
||||
fid = new Regex(link.getPluginPatternMatcher(), PATTERN_OLD_1).getMatch(0);
|
||||
if (fid != null) {
|
||||
return fid;
|
||||
}
|
||||
fid = new Regex(link.getPluginPatternMatcher(), PATTERN_OLD_2).getMatch(0);
|
||||
return fid;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -63,28 +80,53 @@ public class PimpandhostCom extends PluginForHost {
|
||||
return new LazyPlugin.FEATURE[] { LazyPlugin.FEATURE.IMAGE_HOST };
|
||||
}
|
||||
|
||||
/* Extension which will be used if no correct extension is found */
|
||||
private static final String default_extension = ".jpg";
|
||||
/* Connection stuff */
|
||||
private static final int free_maxchunks = 0;
|
||||
private String dllink = null;
|
||||
private String dllink = null;
|
||||
|
||||
@Override
|
||||
public boolean isResumeable(final DownloadLink link, final Account account) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getMaxChunks(final DownloadLink link, final Account account) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAGBLink() {
|
||||
return "https://" + getHost() + "/site/tos";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {
|
||||
return requestFileInformation(link, false);
|
||||
public static List<String[]> getPluginDomains() {
|
||||
final List<String[]> ret = new ArrayList<String[]>();
|
||||
// each entry in List<String[]> will result in one PluginForDecrypt, Plugin.getHost() will return String[0]->main domain
|
||||
ret.add(new String[] { "pimpandhost.com" });
|
||||
return ret;
|
||||
}
|
||||
|
||||
private AvailableStatus requestFileInformation(final DownloadLink link, final boolean isDownload) throws Exception {
|
||||
public static String[] getAnnotationNames() {
|
||||
return buildAnnotationNames(getPluginDomains());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] siteSupportedNames() {
|
||||
return buildSupportedNames(getPluginDomains());
|
||||
}
|
||||
|
||||
public static String[] getAnnotationUrls() {
|
||||
return buildAnnotationUrls(getPluginDomains());
|
||||
}
|
||||
|
||||
public static String[] buildAnnotationUrls(final List<String[]> pluginDomains) {
|
||||
final List<String> ret = new ArrayList<String>();
|
||||
for (final String[] domains : pluginDomains) {
|
||||
ret.add("https?://(?:\\w+\\.)?" + buildHostsPatternPart(domains) + "(" + PATTERN_NORMAL.pattern() + "|" + PATTERN_OLD_1.pattern() + "|" + PATTERN_OLD_2.pattern() + ")");
|
||||
}
|
||||
return ret.toArray(new String[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {
|
||||
final String default_extension = ".jpg";
|
||||
dllink = null;
|
||||
this.setBrowserExclusive();
|
||||
if (!link.isNameSet()) {
|
||||
@ -93,32 +135,17 @@ public class PimpandhostCom extends PluginForHost {
|
||||
br.getPage(link.getPluginPatternMatcher());
|
||||
if (br.getHttpConnection().getResponseCode() == 404) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (br.containsHTML("Image not found")) {
|
||||
} else if (br.containsHTML(">\\s*Image not found")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
final String titleFromURL = new Regex(link.getPluginPatternMatcher(), "/(.*)$").getMatch(0);
|
||||
final String filesize = this.br.getRegex(">\\s*Size: ([^<>\"]+)<").getMatch(0);
|
||||
String filesize = br.getRegex(">Size:\\s*([^&]+)&").getMatch(0);
|
||||
String filename = br.getRegex("data-filename=\"([^\"]+)").getMatch(0);
|
||||
if (filename == null && titleFromURL != null) {
|
||||
/* Fallback */
|
||||
filename = titleFromURL.replace("-", " ").trim();
|
||||
}
|
||||
if (filename != null) {
|
||||
filename = Encoding.htmlDecode(filename);
|
||||
filename = filename.trim();
|
||||
}
|
||||
// could be password protected
|
||||
if (br.containsHTML("<h4>\\s*Album\\s*'.*?'\\s*is protected with password\\s*</h4>")) {
|
||||
// don't know password to implement support
|
||||
link.setName(filename);
|
||||
throw new PluginException(LinkStatus.ERROR_FATAL, "Password protected items are not yet supported | Contact JDownloader support");
|
||||
}
|
||||
/* Alternative way to get highest quality: br.getPage("http://pimpandhost.com/image/" + picID + "-original.html"); */
|
||||
dllink = br.getRegex("data-src=\"([^\"]+)").getMatch(0);
|
||||
if (dllink == null) {
|
||||
dllink = br.getRegex("<img[^>]*?class=\"normal\"[^>]*?src=\"(https?[^<>\"]+)\"").getMatch(0);
|
||||
dllink = br.getRegex("<img[^>]*class=\"normal\"[^>]*src=\"(https?[^<>\"]+)\"").getMatch(0);
|
||||
if (dllink == null) {
|
||||
dllink = br.getRegex("<img[^>]*?class=\"normal\"[^>]*?src=\"(//[^<>\"]+)\"").getMatch(0);
|
||||
dllink = br.getRegex("<img[^>]*class=\"normal\"[^>]*src=\"(//[^<>\"]+)\"").getMatch(0);
|
||||
}
|
||||
}
|
||||
final String ext;
|
||||
@ -128,17 +155,22 @@ public class PimpandhostCom extends PluginForHost {
|
||||
ext = default_extension;
|
||||
}
|
||||
if (filename != null) {
|
||||
if (!filename.endsWith(ext)) {
|
||||
filename += ext;
|
||||
}
|
||||
filename = Encoding.htmlDecode(filename);
|
||||
filename = filename.trim();
|
||||
filename = this.correctOrApplyFileNameExtension(filename, ext, null);
|
||||
link.setFinalFileName(filename);
|
||||
}
|
||||
final boolean isDownload = this.getPluginEnvironment() == PluginEnvironment.DOWNLOAD;
|
||||
if (filesize != null) {
|
||||
link.setDownloadSize(SizeFormatter.getSize(filesize));
|
||||
link.setName(filename);
|
||||
} else if (dllink != null && !isDownload) {
|
||||
} else if (!isDownload && !link.isSizeSet() && !StringUtils.isEmpty(this.dllink)) {
|
||||
basicLinkCheck(br.cloneBrowser(), br.createHeadRequest(dllink), link, filename, ext);
|
||||
}
|
||||
// could be password protected
|
||||
if (isDownload && br.containsHTML("<h4>\\s*Album\\s*'.*?'\\s*is protected with password\\s*</h4>")) {
|
||||
throw new PluginException(LinkStatus.ERROR_FATAL, "Password protected items are not yet supported | Contact JDownloader support");
|
||||
}
|
||||
return AvailableStatus.TRUE;
|
||||
}
|
||||
|
||||
@ -148,7 +180,7 @@ public class PimpandhostCom extends PluginForHost {
|
||||
if (StringUtils.isEmpty(dllink)) {
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
dl = new jd.plugins.BrowserAdapter().openDownload(br, link, dllink, this.isResumeable(link, null), free_maxchunks);
|
||||
dl = new jd.plugins.BrowserAdapter().openDownload(br, link, dllink, this.isResumeable(link, null), this.getMaxChunks(link, null));
|
||||
handleConnectionErrors(br, dl.getConnection());
|
||||
dl.startDownload();
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ import jd.plugins.LinkStatus;
|
||||
import jd.plugins.PluginException;
|
||||
import jd.plugins.PluginForHost;
|
||||
|
||||
@HostPlugin(revision = "$Revision: 51022 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
@HostPlugin(revision = "$Revision: 51140 $", interfaceVersion = 3, names = {}, urls = {})
|
||||
public class SwiftuploadsCom extends PluginForHost {
|
||||
public SwiftuploadsCom(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
@ -68,6 +68,7 @@ public class SwiftuploadsCom extends PluginForHost {
|
||||
ret.add(new String[] { "uptoearn.xyz" });
|
||||
ret.add(new String[] { "uploadzap.com" });
|
||||
ret.add(new String[] { "akirabox.com" });
|
||||
ret.add(new String[] { "filearn.top" });
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
@ -154,6 +155,31 @@ public class YoutubeLinkGrabberExtender {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void aggregate(CrawledLink cl, final VariantGroup variantGroupOnly, final CounterMap<String> matchingLinks, Set<String> dupeAdd, final ArrayList<VariantInfo> vs, List<VariantInfo> variants) {
|
||||
final Set<String> dupe = new HashSet<String>();
|
||||
for (VariantInfo vi : variants) {
|
||||
final AbstractVariant variant = vi.getVariant();
|
||||
if (variantGroupOnly == null || variant.getGroup() == variantGroupOnly) {
|
||||
final String id;
|
||||
if (variant instanceof SubtitleVariant) {
|
||||
id = variant._getUniqueId();
|
||||
} else if (variant instanceof AudioVariant) {
|
||||
id = variant._getUniqueId();
|
||||
} else if (variant instanceof VideoVariant) {
|
||||
id = variant._getUniqueId();
|
||||
} else {
|
||||
id = new VariantIDStorable(variant).createUniqueID();
|
||||
}
|
||||
if (dupe.add(id)) {
|
||||
matchingLinks.increment(id);
|
||||
}
|
||||
if (dupeAdd.add(id)) {
|
||||
vs.add(vi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void addVariants() {
|
||||
if (pv.getChildren().size() == 1) {
|
||||
((YoutubeHostPluginInterface) pv.getPlugin()).showChangeOrAddVariantDialog(pv.getChildren().get(0), null);
|
||||
@ -162,23 +188,6 @@ public class YoutubeLinkGrabberExtender {
|
||||
ProgressGetter pg = new ProgressGetter() {
|
||||
private int done;
|
||||
|
||||
protected void aggregate(CrawledLink cl, final CounterMap<String> matchingLinks, HashSet<String> dupeAdd, final ArrayList<VariantInfo> vs, List<VariantInfo> variants) {
|
||||
HashSet<String> dupe = new HashSet<String>();
|
||||
;
|
||||
for (VariantInfo vi : variants) {
|
||||
String id = new VariantIDStorable(vi.getVariant()).createUniqueID();
|
||||
if (vi.getVariant() instanceof SubtitleVariant) {
|
||||
id = vi.getVariant()._getUniqueId();
|
||||
}
|
||||
if (dupe.add(id)) {
|
||||
matchingLinks.increment(id);
|
||||
}
|
||||
if (dupeAdd.add(id)) {
|
||||
vs.add(vi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
final CounterMap<String> matchingLinks = new CounterMap<String>();
|
||||
@ -195,9 +204,9 @@ public class YoutubeLinkGrabberExtender {
|
||||
}
|
||||
List<VariantInfo> variants = clipData.findVariants();
|
||||
helper.extendedDataLoading(variants);
|
||||
aggregate(cl, matchingLinks, dupeAdd, vs, variants);
|
||||
aggregate(cl, matchingLinks, dupeAdd, vs, clipData.findDescriptionVariant());
|
||||
aggregate(cl, matchingLinks, dupeAdd, vs, clipData.findSubtitleVariants());
|
||||
aggregate(cl, null, matchingLinks, dupeAdd, vs, variants);
|
||||
aggregate(cl, null, matchingLinks, dupeAdd, vs, clipData.findDescriptionVariant());
|
||||
aggregate(cl, null, matchingLinks, dupeAdd, vs, clipData.findSubtitleVariants());
|
||||
} finally {
|
||||
done++;
|
||||
}
|
||||
@ -319,24 +328,6 @@ public class YoutubeLinkGrabberExtender {
|
||||
}.start();
|
||||
}
|
||||
|
||||
protected void aggregate(CrawledLink cl, final VariantGroup g, final CounterMap<String> matchingLinks, HashSet<String> dupeAdd, final ArrayList<VariantInfo> vs, List<VariantInfo> variants) {
|
||||
HashSet<String> dupe = new HashSet<String>();
|
||||
for (VariantInfo vi : variants) {
|
||||
if (vi.getVariant().getGroup() == g) {
|
||||
String id = new VariantIDStorable(vi.getVariant()).createUniqueID();
|
||||
if (g == VariantGroup.SUBTITLES) {
|
||||
id = vi.getVariant()._getUniqueId();
|
||||
}
|
||||
if (dupe.add(id)) {
|
||||
matchingLinks.increment(id);
|
||||
}
|
||||
if (dupeAdd.add(id)) {
|
||||
vs.add(vi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString() {
|
||||
return null;
|
||||
|
@ -1,5 +1,8 @@
|
||||
package org.jdownloader.plugins.components.youtube.configpanel;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.appwork.txtresource.TranslationFactory;
|
||||
import org.jdownloader.plugins.components.youtube.Projection;
|
||||
import org.jdownloader.plugins.components.youtube.VariantIDStorable;
|
||||
import org.jdownloader.plugins.components.youtube.itag.AudioType;
|
||||
@ -63,6 +66,17 @@ public class AbstractVariantWrapper {
|
||||
return lng;
|
||||
}
|
||||
|
||||
public Locale getLanguageLocale() {
|
||||
if (variant instanceof AudioInterface) {
|
||||
return ((AudioInterface) variant).getAudioLocale();
|
||||
} else if (variant instanceof SubtitleVariant) {
|
||||
final String lng = ((SubtitleVariant) variant).getLanguageCode();
|
||||
return TranslationFactory.stringToLocale(lng.replaceAll("[^a-zA-Z\\-]*", ""));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
if (variant instanceof VideoVariant) {
|
||||
return ((VideoVariant) variant).getVideoWidth();
|
||||
|
@ -8,6 +8,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.Icon;
|
||||
@ -15,6 +16,8 @@ import javax.swing.JTable;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.table.JTableHeader;
|
||||
|
||||
import jd.gui.swing.jdgui.AlternateHighlighter;
|
||||
|
||||
import org.appwork.storage.config.ValidationException;
|
||||
import org.appwork.storage.config.events.GenericConfigEventListener;
|
||||
import org.appwork.storage.config.handler.KeyHandler;
|
||||
@ -51,8 +54,6 @@ import org.jdownloader.settings.staticreferences.CFG_YOUTUBE;
|
||||
import org.jdownloader.translate._JDT;
|
||||
import org.jdownloader.updatev2.gui.LAFOptions;
|
||||
|
||||
import jd.gui.swing.jdgui.AlternateHighlighter;
|
||||
|
||||
public class VariantsMapTableModel extends ExtTableModel<AbstractVariantWrapper> implements GenericConfigEventListener<Object> {
|
||||
protected static int globalCompare(int ret, AbstractVariantWrapper o1, AbstractVariantWrapper o2, boolean b) {
|
||||
if (ret != 0) {
|
||||
@ -639,12 +640,17 @@ public class VariantsMapTableModel extends ExtTableModel<AbstractVariantWrapper>
|
||||
addColumn(new AutoResizingTextColumn(_GUI.T.YOUTUBE_CONFIG_PANEL_TABLE_LANGUAGE()) {
|
||||
@Override
|
||||
public String getStringValue(AbstractVariantWrapper value) {
|
||||
final AudioType audioType = value.getAudioType();
|
||||
final String ret = value.getLanguageCode();
|
||||
if (audioType != null) {
|
||||
return ret + " " + audioType.getLabel();
|
||||
final Locale locale = value.getLanguageLocale();
|
||||
if (locale == null) {
|
||||
return "";
|
||||
}
|
||||
final String displayName = locale.getDisplayName();
|
||||
final AudioType audioType = value.getAudioType();
|
||||
if (audioType == null) {
|
||||
return displayName;
|
||||
} else {
|
||||
return displayName + " (" + audioType.getLabel() + ")";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -674,7 +680,12 @@ public class VariantsMapTableModel extends ExtTableModel<AbstractVariantWrapper>
|
||||
return value.variant._getName(null);
|
||||
}
|
||||
default:
|
||||
return value.variant.getGroup().getLabel();
|
||||
final AudioType audioType = value.getAudioType();
|
||||
if (audioType == null) {
|
||||
return value.variant.getGroup().getLabel();
|
||||
} else {
|
||||
return value.variant.getGroup().getLabel() + " (" + audioType.getLabel() + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -35,6 +35,7 @@ public class SubtitleVariant extends AbstractVariant<YoutubeSubtitleStorable> {
|
||||
|
||||
@Override
|
||||
public String _getUniqueId() {
|
||||
// TODO: add Translated/SpeedToText support
|
||||
return getGenericInfo()._getUniqueId();
|
||||
}
|
||||
|
||||
|
@ -265,6 +265,7 @@ public class CrossSystem {
|
||||
MAC_VENTURA(OSFamily.MAC), // 10.18/13.00
|
||||
MAC_SONOMA(OSFamily.MAC), // 10.19/14.00
|
||||
MAC_SEQUOIA(OSFamily.MAC), // 10.20/15.00
|
||||
MAC_TAHOE(OSFamily.MAC), // 10.26/10.21/26.00 unconfirmed
|
||||
/*
|
||||
* OS2
|
||||
*/
|
||||
@ -1042,7 +1043,10 @@ public class CrossSystem {
|
||||
}
|
||||
final long version = Math.max(parseMacOSVersion(osVersion), parseMacOSVersion(sw_ver.get()));
|
||||
// new version scheme
|
||||
if (version >= 15000000) {
|
||||
if (version >= 26000000) {
|
||||
// TODO: unconfirmed
|
||||
return OperatingSystem.MAC_TAHOE;
|
||||
} else if (version >= 15000000) {
|
||||
return OperatingSystem.MAC_SEQUOIA;
|
||||
} else if (version >= 14000000) {
|
||||
return OperatingSystem.MAC_SONOMA;
|
||||
@ -1054,7 +1058,10 @@ public class CrossSystem {
|
||||
return OperatingSystem.MAC_BIG_SUR;
|
||||
} else {
|
||||
// old version scheme
|
||||
if (version >= 10020000) {
|
||||
if (version >= 10021000 || version >= 10026000) {
|
||||
// TODO: unconfirmed
|
||||
return OperatingSystem.MAC_TAHOE;
|
||||
} else if (version >= 10020000) {
|
||||
// os.version=10.20
|
||||
return OperatingSystem.MAC_SEQUOIA;
|
||||
} else if (version >= 10019000) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user