Skip to content

Commit f3cd52c

Browse files
author
updating-bot
committed
mirroring bot - 2025/10/31
1 parent b9a7d86 commit f3cd52c

File tree

11 files changed

+334
-258
lines changed

11 files changed

+334
-258
lines changed

svn_trunk/src/jd/plugins/AccountInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ public List<MultiHostHost> setMultiHostSupportV2(final PluginForHost multiHostPl
582582
mhost.setStatus(MultihosterHostStatus.DEACTIVATED_JDOWNLOADER);
583583
mhost.setStatusText("Permanently offline");
584584
if (skipOfflineEntries) {
585-
/* Skip such items completely in stable */
585+
/* Skip such items in stable version of JDownloader. */
586586
continue cleanListLoop;
587587
}
588588
} else {

svn_trunk/src/jd/plugins/decrypter/FilerNetFolder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import jd.plugins.PluginForHost;
4242
import jd.plugins.hoster.FilerNet;
4343

44-
@DecrypterPlugin(revision = "$Revision: 51754 $", interfaceVersion = 2, names = {}, urls = {})
44+
@DecrypterPlugin(revision = "$Revision: 51777 $", interfaceVersion = 2, names = {}, urls = {})
4545
@PluginDependencies(dependencies = { FilerNet.class })
4646
public class FilerNetFolder extends PluginForDecrypt {
4747
public FilerNetFolder(PluginWrapper wrapper) {
@@ -118,10 +118,10 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
118118
if (count == 0) {
119119
throw new DecrypterRetryException(RetryReason.EMPTY_FOLDER, folderID);
120120
}
121-
String fpName = (String) data.get("name");
122-
if (fpName == null) {
121+
String title = (String) data.get("name");
122+
if (title == null) {
123123
/* Fallback */
124-
fpName = "filer.net folder: " + folderID;
124+
title = "filer.net folder: " + folderID;
125125
}
126126
final List<Map<String, Object>> files = (List<Map<String, Object>>) data.get("files");
127127
for (final Map<String, Object> file : files) {
@@ -132,7 +132,7 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
132132
ret.add(link);
133133
}
134134
final FilePackage fp = FilePackage.getInstance();
135-
fp.setName(fpName);
135+
fp.setName(title);
136136
fp.setPackageKey("filer.net://folder/" + folderID);
137137
fp.addLinks(ret);
138138
return ret;

svn_trunk/src/jd/plugins/decrypter/GigafileNuFolderCrawler.java

Lines changed: 57 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import jd.plugins.PluginForDecrypt;
4343
import jd.plugins.hoster.GigafileNu;
4444

45-
@DecrypterPlugin(revision = "$Revision: 51770 $", interfaceVersion = 3, names = {}, urls = {})
45+
@DecrypterPlugin(revision = "$Revision: 51775 $", interfaceVersion = 3, names = {}, urls = {})
4646
public class GigafileNuFolderCrawler extends PluginForDecrypt {
4747
public GigafileNuFolderCrawler(PluginWrapper wrapper) {
4848
super(wrapper);
@@ -107,136 +107,121 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
107107
/* There is no specific single file URL -> set "folder" URL as contenturl. */
108108
link.setContentUrl(contenturl);
109109
String filename = matomete_file_names != null && matomete_file_names.length == ressourcelist.size() ? matomete_file_names[i] : null;
110-
String censoredExtension = null;
111-
if (filename != null && filename.matches("^\\.[a-z0-9]{2,4}$")) {
112-
censoredExtension = filename;
113-
filename = null;
114-
}
115-
/*
116-
* If this is set to true, this means that no usable filename was found here and it will need to be fetched by the hoster
117-
* plugin during linkcheck.
118-
*/
119-
boolean prefer_report_api = false;
120110
if (!GigafileNu.isFilename(filename)) {
121-
prefer_report_api = StringUtils.isNotEmpty(filename);
122111
filename = br.getRegex("download\\('" + Pattern.quote(fileID) + "[^>]*>\\s*(.*?)\\s*<").getMatch(0);
123112
}
124113
if (!GigafileNu.isFilename(filename)) {
125-
prefer_report_api = prefer_report_api || StringUtils.isNotEmpty(filename);
126114
filename = null;
127115
}
128116
if (StringUtils.isNotEmpty(filename)) {
129-
prefer_report_api = false;
130117
filename = Encoding.htmlDecode(filename).trim();
131118
link.setName(filename);
132119
link.setProperty(GigafileNu.PROPERTY_FILE_NAME_FROM_CRAWLER, filename);
133120
link.setAvailableStatus(AvailableStatus.TRUE);
134121
} else {
135122
/* Fallback: Set dummy filename to avoid all results having the same file name. */
136-
link.setName(fileID + StringUtils.valueOrEmpty(censoredExtension));
123+
link.setName(fileID);
137124
/* Do not set online status here so that hoster plugin can find the real filenames. */
138125
link.setAvailableStatus(AvailableStatus.UNCHECKED);
139126
}
140127
link.setVerifiedFileSize(filesize);
141-
if (prefer_report_api) {
142-
link.setProperty(GigafileNu.REPORT_WORKAROUND_PROPERTY, Boolean.TRUE);
143-
}
144128
link.setProperty(GigafileNu.PROPERTY_FILE_ID, fileID);
145129
totalFilesize += filesize;
146130
if (!filesFolders.containsKey(fileID)) {
147131
filesFolders.put(fileID, link);
148132
}
149133
}
150134
}
151-
DownloadLink singleZipOrFile = null;
135+
DownloadLink combinedZipOrFile = null;
136+
boolean singleFileIsCombinedZip = false;
152137
final String singleFileID = br.getRegex("var file = \"([^\"]+)").getMatch(0);
153138
if (singleFileID != null && !filesFolders.containsKey(singleFileID)) {
154-
singleZipOrFile = this.createDownloadlink(contenturl);
155-
singleZipOrFile.setDefaultPlugin(hosterplugin);
156-
singleZipOrFile.setHost(this.getHost());
139+
combinedZipOrFile = this.createDownloadlink(contenturl);
140+
combinedZipOrFile.setDefaultPlugin(hosterplugin);
141+
combinedZipOrFile.setHost(this.getHost());
157142
/* There is no specific single file URL -> set "folder" URL as contenturl. */
158-
singleZipOrFile.setContentUrl(contenturl);
143+
combinedZipOrFile.setContentUrl(contenturl);
159144
String filename = br.getRegex("matomete_zip_filename\"[^>]*>\\s*(.*?)\\s*<").getMatch(0);
160145
/*
161146
* If this is set to true, this means that no usable filename was found here and it will need to be fetched by the hoster plugin
162147
* during linkcheck.
163148
*/
164-
boolean prefer_report_api = false;
165149
if (!GigafileNu.isFilename(filename)) {
166-
prefer_report_api = StringUtils.isNotEmpty(filename);
167150
filename = br.getRegex("download\\('" + Pattern.quote(singleFileID) + "[^>]*>\\s*(.*?)\\s*<").getMatch(0);
168151
}
169152
if (!GigafileNu.isFilename(filename)) {
170-
prefer_report_api = prefer_report_api || StringUtils.isNotEmpty(filename);
171153
filename = null;
172154
}
173-
String extensionForSingleFile = null;// TODO
174155
if (StringUtils.isNotEmpty(filename)) {
175-
prefer_report_api = false;
176156
filename = Encoding.htmlDecode(filename).trim();
177-
singleZipOrFile.setName(filename);
178-
singleZipOrFile.setProperty(GigafileNu.PROPERTY_FILE_NAME_FROM_CRAWLER, filename);
179-
singleZipOrFile.setAvailableStatus(AvailableStatus.TRUE);
180-
} else if (extensionForSingleFile != null) {
181-
/* We do not know a filename but we know the file extension */
182-
singleZipOrFile.setName(singleFileID + extensionForSingleFile);
183-
/* Do not set online status here so that hoster plugin can find the real filenames. */
184-
singleZipOrFile.setAvailableStatus(AvailableStatus.UNCHECKED);
157+
combinedZipOrFile.setName(filename);
158+
combinedZipOrFile.setProperty(GigafileNu.PROPERTY_FILE_NAME_FROM_CRAWLER, filename);
159+
combinedZipOrFile.setAvailableStatus(AvailableStatus.TRUE);
185160
} else {
186161
/* Fallback */
187162
/* Set .zip extension as we just assume that this is the .zip file containing all other files. */
188-
singleZipOrFile.setName(singleFileID + ".zip");
163+
combinedZipOrFile.setName(singleFileID + ".zip");
189164
/* Do not set online status here so that hoster plugin can find the real filenames. */
190-
singleZipOrFile.setAvailableStatus(AvailableStatus.UNCHECKED);
165+
combinedZipOrFile.setAvailableStatus(AvailableStatus.UNCHECKED);
191166
}
192167
final String fileSizeBytesStr = br.getRegex("var size = (\\d+);").getMatch(0);
193168
if (fileSizeBytesStr != null) {
194-
singleZipOrFile.setVerifiedFileSize(Long.parseLong(fileSizeBytesStr));
169+
combinedZipOrFile.setVerifiedFileSize(Long.parseLong(fileSizeBytesStr));
195170
} else if (totalFilesize > 0) {
196171
/*
197172
* Use total size of all other files as fallback value -> Assume that this is the .zip file containing all other files.
198173
*/
199-
singleZipOrFile.setDownloadSize(totalFilesize);
174+
combinedZipOrFile.setDownloadSize(totalFilesize);
200175
} else {
201176
logger.warning("Failed to find size of single file in html code");
202177
}
203-
if (prefer_report_api) {
204-
singleZipOrFile.setProperty(GigafileNu.REPORT_WORKAROUND_PROPERTY, Boolean.TRUE);
178+
combinedZipOrFile.setProperty(GigafileNu.PROPERTY_FILE_ID, singleFileID);
179+
if (GigafileNu.isCombinedZipDownload(br, singleFileID)) {
180+
singleFileIsCombinedZip = true;
181+
combinedZipOrFile.setProperty(GigafileNu.REPORT_IS_COMPLETE_ZIP, true);
205182
}
206-
singleZipOrFile.setProperty(GigafileNu.PROPERTY_FILE_ID, singleFileID);
207183
}
208-
final CrawlMode crawlMode = PluginJsonConfig.get(getConfigInterface()).getCrawlMode().getMode();
209184
final ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
210-
switch (crawlMode) {
211-
case ALL:
212-
ret.addAll(filesFolders.values());
213-
if (singleZipOrFile != null) {
214-
ret.add(singleZipOrFile);
215-
}
216-
break;
217-
case FILES_FOLDERS:
185+
if (filesFolders.size() == 1 && singleFileIsCombinedZip) {
186+
/*
187+
* "smart" optimization: if there is only one single file and the .zip containing that same file, return only that single file
188+
* regardless of the users' settings
189+
*/
190+
logger.info("Single file and combined .zip");
218191
ret.addAll(filesFolders.values());
219-
if (ret.size() == 0 && singleZipOrFile != null) {
220-
// add zip because it's the only file
221-
ret.add(singleZipOrFile);
222-
}
223-
break;
224-
case ZIP:
225-
if (singleZipOrFile != null) {
226-
ret.add(singleZipOrFile);
192+
} else {
193+
final CrawlMode crawlMode = PluginJsonConfig.get(getConfigInterface()).getCrawlMode().getMode();
194+
switch (crawlMode) {
195+
case ALL:
196+
ret.addAll(filesFolders.values());
197+
if (combinedZipOrFile != null) {
198+
ret.add(combinedZipOrFile);
199+
}
200+
break;
201+
case FILES_FOLDERS:
202+
ret.addAll(filesFolders.values());
203+
if (ret.size() == 0 && combinedZipOrFile != null) {
204+
// add zip because it's the only file
205+
ret.add(combinedZipOrFile);
206+
}
207+
break;
208+
case ZIP:
209+
if (combinedZipOrFile != null) {
210+
ret.add(combinedZipOrFile);
211+
}
212+
break;
213+
default:
214+
/* Developer mistake */
215+
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT, "Unsupported CrawlMode:" + crawlMode);
227216
}
228-
break;
229-
default:
230-
/* Developer mistake */
231-
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT, "Unsupported CrawlMode:" + crawlMode);
232-
}
233-
if (ret.isEmpty()) {
234-
if (!br.containsHTML("download\\('" + content_id_from_url) && !GigafileNu.isSingleZipDownload(br, content_id_from_url)) {
235-
/* Assume that item is offline */
236-
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
237-
} else {
238-
/* Unknown state */
239-
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
217+
if (ret.isEmpty()) {
218+
if (!br.containsHTML("download\\('" + content_id_from_url) && !GigafileNu.isCombinedZipDownload(br, content_id_from_url)) {
219+
/* Assume that item is offline */
220+
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
221+
} else {
222+
/* Unknown state */
223+
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
224+
}
240225
}
241226
}
242227
final FilePackage fp = FilePackage.getInstance();

svn_trunk/src/jd/plugins/decrypter/PinterestComDecrypter.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
import jd.plugins.PluginForHost;
5454
import jd.plugins.hoster.PinterestCom;
5555

56-
@DecrypterPlugin(revision = "$Revision: 51759 $", interfaceVersion = 3, names = {}, urls = {})
56+
@DecrypterPlugin(revision = "$Revision: 51780 $", interfaceVersion = 3, names = {}, urls = {})
5757
@PluginDependencies(dependencies = { PinterestCom.class })
5858
public class PinterestComDecrypter extends PluginForDecrypt {
5959
public PinterestComDecrypter(PluginWrapper wrapper) {
@@ -535,7 +535,7 @@ public static Map<String, Object> getPINMap(final Browser br, final String pinUR
535535
if (pinID == null) {
536536
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
537537
}
538-
final String[] jssnippets = br.getRegex("<script data-relay-response=\"true\" type=\"application/json\">(.*?)</script>").getColumn(0);
538+
final String[] jssnippets = br.getRegex("<script[^>]*type=\"application/json\"[^>]*>(.*?)</script>").getColumn(0);
539539
if (jssnippets != null && jssnippets.length > 0) {
540540
/* Try to find json source in html code */
541541
for (final String jssnippet : jssnippets) {
@@ -544,7 +544,11 @@ public static Map<String, Object> getPINMap(final Browser br, final String pinUR
544544
continue;
545545
}
546546
final Map<String, Object> map = (Map<String, Object>) parsedjson;
547-
final Map<String, Object> pin_root = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "response/data/v3GetPinQuery/data");
547+
Map<String, Object> pin_root = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "response/data/v3GetPinQuery/data");
548+
if (pin_root == null) {
549+
/* 2025-10-30: When logged in */
550+
pin_root = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "initialReduxState/resources/PinResource/{0}/data");
551+
}
548552
if (pin_root != null) {
549553
return pin_root;
550554
}

0 commit comments

Comments
 (0)