Skip to content

Commit 75333cd

Browse files
author
updating-bot
committed
mirroring bot - 2025/09/02
1 parent 1e62c3c commit 75333cd

File tree

16 files changed

+294
-108
lines changed

16 files changed

+294
-108
lines changed

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

Lines changed: 93 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
import org.jdownloader.plugins.controller.host.LazyHostPlugin;
5454
import org.jdownloader.scripting.JavaScriptEngineFactory;
5555

56-
@DecrypterPlugin(revision = "$Revision: 51164 $", interfaceVersion = 3, names = {}, urls = {})
56+
@DecrypterPlugin(revision = "$Revision: 51424 $", interfaceVersion = 3, names = {}, urls = {})
5757
public class BunkrAlbum extends PluginForDecrypt {
5858
public BunkrAlbum(PluginWrapper wrapper) {
5959
super(wrapper);
@@ -138,11 +138,21 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
138138
if (br.getHttpConnection().getResponseCode() == 404) {
139139
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
140140
}
141+
final boolean enforceAdvancedView = false;// also works for smaller albums
142+
boolean advancedView = false;
143+
if (br.containsHTML("<a\\s*href\\s*=\\s*\"\\?advanced=1\"") || enforceAdvancedView) {
144+
// all images on one page
145+
br.getPage("?advanced=1");
146+
advancedView = true;
147+
}
141148
final HashSet<String> dups = new HashSet<String>();
142149
/* Double-check for offline / empty album. */
143150
final String albumID = new Regex(param.getCryptedUrl(), PATTERN_ALBUM).getMatch(0);
144151
int numberofFiles = -1;
145-
final String numberofFilesStr = br.getRegex(">\\s*(\\d+)\\s*files").getMatch(0);
152+
String numberofFilesStr = br.getRegex(">\\s*(\\d+)\\s*files").getMatch(0);
153+
if (numberofFilesStr == null) {
154+
numberofFilesStr = br.getRegex("\"Explore\\s*this\\s*album\\s*with\\s*(\\d+)\\s*files").getMatch(0);
155+
}
146156
if (numberofFilesStr != null) {
147157
numberofFiles = Integer.parseInt(numberofFilesStr);
148158
} else {
@@ -159,62 +169,97 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
159169
} else {
160170
logger.warning("Failed to find album title");
161171
}
162-
String json = br.getRegex("<script\\s*id\\s*=\\s*\"__NEXT_DATA__\"\\s*type\\s*=\\s*\"application/json\">\\s*(\\{.*?\\})\\s*</script").getMatch(0);
163-
if (json != null) {
164-
final Map<String, Object> map = restoreFromString(json, TypeRef.MAP);
165-
List<Map<String, Object>> files = (List<Map<String, Object>>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/files");
166-
if (files == null) {
167-
files = (List<Map<String, Object>>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/album/files");
168-
}
169-
if (files == null) {
170-
files = new ArrayList<Map<String, Object>>();
171-
}
172-
Map<String, Object> pagePropsFile = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/file");
173-
if (pagePropsFile == null) {
174-
pagePropsFile = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/album/file");
175-
}
176-
if (pagePropsFile != null) {
177-
files.add(pagePropsFile);
178-
}
179-
if (files != null) {
172+
if (advancedView) {
173+
String advancedViewJson = br.getRegex("<script[^>]*>\\s*window\\.albumFiles\\s*=\\s*(\\[.*?\\]\\s*);\\s*(console.*?)?</script").getMatch(0);
174+
if (advancedViewJson != null) {
175+
advancedViewJson = advancedViewJson.replaceAll("(\\{|,)\\s*(\\w+)\\s*:", "$1\"$2\":");// convert from javascript to json
176+
final List<Map<String, Object>> files = (List<Map<String, Object>>) JavaScriptEngineFactory.jsonToJavaObject(advancedViewJson);
180177
for (final Map<String, Object> file : files) {
181-
final String name = (String) file.get("name");
182-
String cdn = (String) file.get("cdn");
183-
if (cdn == null) {
184-
cdn = (String) file.get("mediafiles");
185-
}
178+
final String slug = (String) file.get("slug");
179+
final String originalName = (String) file.get("original");
180+
final String serverName = (String) file.get("name");
186181
final String size = StringUtils.valueOfOrNull(file.get("size"));
187-
if (name != null && cdn != null) {
188-
final String directurl = URLHelper.parseLocation(new URL(cdn), name);
189-
add(ret, dups, directurl, name, size != null && size.matches("[0-9]+") ? size : null, size != null && !size.matches("[0-9]+") ? size : null, true);
182+
if (slug != null) {
183+
final String directurl = br.getURL("/f/" + slug).toExternalForm();
184+
add(ret, dups, directurl, StringUtils.firstNotEmpty(originalName, serverName), size != null && size.matches("[0-9]+") ? size : null, size != null && !size.matches("[0-9]+") ? size : null, true);
190185
}
191186
}
192187
}
193-
}
194-
final String[] htmls = br.getRegex("<div class=\"grid-images_box(?: rounded-lg)?[^\"]+\"(.*?)</div>\\s+</div>").getColumn(0);
195-
for (final String html : htmls) {
196-
String directurl = new Regex(html, "href\\s*=\\s*\"(https?://[^\"]+)\"").getMatch(0);
197-
if (directurl == null) {
198-
final String[] urls = HTMLParser.getHttpLinks(html, br.getURL());
199-
for (final String url : urls) {
200-
if (new Regex(url, BunkrAlbum.PATTERN_SINGLE_FILE).patternFind()) {
201-
directurl = url;
202-
break;
188+
} else {
189+
final String oldJson = br.getRegex("<script\\s*id\\s*=\\s*\"__NEXT_DATA__\"\\s*type\\s*=\\s*\"application/json\">\\s*(\\{.*?\\})\\s*</script").getMatch(0);
190+
if (oldJson != null) {
191+
// TODO: can we remove this?
192+
final Map<String, Object> map = restoreFromString(oldJson, TypeRef.MAP);
193+
List<Map<String, Object>> files = (List<Map<String, Object>>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/files");
194+
if (files == null) {
195+
files = (List<Map<String, Object>>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/album/files");
196+
}
197+
if (files == null) {
198+
files = new ArrayList<Map<String, Object>>();
199+
}
200+
Map<String, Object> pagePropsFile = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/file");
201+
if (pagePropsFile == null) {
202+
pagePropsFile = (Map<String, Object>) JavaScriptEngineFactory.walkJson(map, "props/pageProps/album/file");
203+
}
204+
if (pagePropsFile != null) {
205+
files.add(pagePropsFile);
206+
}
207+
if (files != null) {
208+
for (final Map<String, Object> file : files) {
209+
final String name = (String) file.get("name");
210+
String cdn = (String) file.get("cdn");
211+
if (cdn == null) {
212+
cdn = (String) file.get("mediafiles");
213+
}
214+
final String size = StringUtils.valueOfOrNull(file.get("size"));
215+
if (name != null && cdn != null) {
216+
final String directurl = URLHelper.parseLocation(new URL(cdn), name);
217+
add(ret, dups, directurl, name, size != null && size.matches("[0-9]+") ? size : null, size != null && !size.matches("[0-9]+") ? size : null, true);
218+
}
203219
}
204220
}
205221
}
206-
if (directurl != null) {
207-
String filesizeStr = new Regex(html, "<p class=\"mt-0 dark:text-white-900\"[^>]*>\\s*([^<]*?)\\s*</p>").getMatch(0);
208-
if (filesizeStr == null) {
209-
filesizeStr = new Regex(html, "<p class=\"[^\"]*theSize[^\"]*\"[^>]*>\\s*([^<]*?)\\s*</p>").getMatch(0);
222+
Browser pageBr = br;
223+
while (true) {
224+
final String[] htmls = pageBr.getRegex("<div class=\"grid-images_box(?: rounded-lg)?[^\"]+\"(.*?)</div>\\s+</div>").getColumn(0);
225+
for (final String html : htmls) {
226+
if (html.contains("/f/' + file.slug")) {
227+
// coding entry used by javascript filling for next entries while scroling
228+
continue;
229+
}
230+
String directurl = new Regex(html, "href\\s*=\\s*\"(https?://[^\"]+)\"").getMatch(0);
231+
if (directurl == null || !new Regex(directurl, BunkrAlbum.PATTERN_SINGLE_FILE).patternFind()) {
232+
directurl = null;
233+
final String[] urls = HTMLParser.getHttpLinks(html, pageBr.getURL());
234+
for (final String url : urls) {
235+
if (new Regex(url, BunkrAlbum.PATTERN_SINGLE_FILE).patternFind()) {
236+
directurl = url;
237+
break;
238+
}
239+
}
240+
}
241+
if (directurl != null) {
242+
String filesizeStr = new Regex(html, "<p class=\"mt-0 dark:text-white-900\"[^>]*>\\s*([^<]*?)\\s*</p>").getMatch(0);
243+
if (filesizeStr == null) {
244+
filesizeStr = new Regex(html, "<p class=\"[^\"]*theSize[^\"]*\"[^>]*>\\s*([^<]*?)\\s*</p>").getMatch(0);
245+
}
246+
String filename = new Regex(html, "<div\\s*class\\s*=\\s*\"[^\"]*details\"\\s*>\\s*<p\\s*class[^>]*>\\s*(.*?)\\s*<").getMatch(0);
247+
if (filename == null) {
248+
filename = new Regex(html, "<p class=\"[^\"]*theName[^\"]*\"[^>]*>\\s*([^<]*?)\\s*</p>").getMatch(0);
249+
}
250+
add(ret, dups, directurl, filename, null, filesizeStr, true);
251+
} else {
252+
logger.warning("html Parser broken? HTML: " + html);
253+
}
210254
}
211-
String filename = new Regex(html, "<div\\s*class\\s*=\\s*\"[^\"]*details\"\\s*>\\s*<p\\s*class[^>]*>\\s*(.*?)\\s*<").getMatch(0);
212-
if (filename == null) {
213-
filename = new Regex(html, "<p class=\"[^\"]*theName[^\"]*\"[^>]*>\\s*([^<]*?)\\s*</p>").getMatch(0);
255+
final String nextPage = pageBr.getRegex("<a\\s*href\\s*=\\s*\"(\\?page=\\d+)\"\\s*>\\s*(»|&raquo;)\\s*<").getMatch(0);
256+
if (nextPage != null) {
257+
logger.info("next page," + nextPage);
258+
pageBr.getPage(nextPage);
259+
} else {
260+
logger.info("no next page, stop");
261+
break;
214262
}
215-
add(ret, dups, directurl, filename, null, filesizeStr, true);
216-
} else {
217-
logger.warning("html Parser broken? HTML: " + html);
218263
}
219264
}
220265
if (ret.isEmpty()) {

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@
2121
import java.util.List;
2222
import java.util.Map;
2323

24-
import org.appwork.storage.TypeRef;
25-
import org.appwork.utils.StringUtils;
26-
import org.appwork.utils.encoding.URLEncode;
27-
import org.appwork.utils.parser.UrlQuery;
28-
import org.jdownloader.controlling.filter.CompiledFiletypeFilter;
29-
import org.jdownloader.controlling.filter.CompiledFiletypeFilter.ExtensionsFilterInterface;
30-
import org.jdownloader.plugins.components.config.Rule34xxxConfig;
31-
import org.jdownloader.plugins.components.config.Rule34xxxConfig.AccessMode;
32-
import org.jdownloader.plugins.config.PluginJsonConfig;
33-
3424
import jd.PluginWrapper;
3525
import jd.controlling.ProgressController;
3626
import jd.http.Browser;
@@ -48,7 +38,17 @@
4838
import jd.plugins.PluginForDecrypt;
4939
import jd.plugins.components.SiteType.SiteTemplate;
5040

51-
@DecrypterPlugin(revision = "$Revision: 51366 $", interfaceVersion = 3, names = { "rule34.xxx" }, urls = { "https?://(?:www\\.)?rule34\\.xxx/index\\.php\\?page=post\\&s=(view\\&id=\\d+|list\\&tags=.+)" })
41+
import org.appwork.storage.TypeRef;
42+
import org.appwork.utils.StringUtils;
43+
import org.appwork.utils.encoding.URLEncode;
44+
import org.appwork.utils.parser.UrlQuery;
45+
import org.jdownloader.controlling.filter.CompiledFiletypeFilter;
46+
import org.jdownloader.controlling.filter.CompiledFiletypeFilter.ExtensionsFilterInterface;
47+
import org.jdownloader.plugins.components.config.Rule34xxxConfig;
48+
import org.jdownloader.plugins.components.config.Rule34xxxConfig.AccessMode;
49+
import org.jdownloader.plugins.config.PluginJsonConfig;
50+
51+
@DecrypterPlugin(revision = "$Revision: 51424 $", interfaceVersion = 3, names = { "rule34.xxx" }, urls = { "https?://(?:www\\.)?rule34\\.xxx/index\\.php\\?page=post\\&s=(view\\&id=\\d+|list\\&tags=.+)" })
5252
public class Rule34Xxx extends PluginForDecrypt {
5353
private final String prefixLinkID = getHost().replaceAll("[\\.\\-]+", "") + "://";
5454
private static final String ERROR_MESSAG_API_CREDENTIALS_REQUIRED = "API credentials required. Add them in plugin settings or change access mode to website and try again.";
@@ -341,7 +341,7 @@ private ArrayList<DownloadLink> crawlWebsite(final CryptedLink param) throws Exc
341341
final String relativeURLWithoutParams = br._getURL().getPath();
342342
do {
343343
// from list to post page
344-
final String[] links = br.getRegex("<a id=\"p\\d+\" href=('|\")(/?index\\.php\\?page=post&(:?amp;)?s=view&(:?amp;)?id=\\d+)\\1").getColumn(1);
344+
final String[] links = br.getRegex("<a id=\"p\\d+\" href=('|\")(/?index\\.php\\?page=post&(:?amp;)?s=view&(:?amp;)?id=\\d+).*?\\1").getColumn(1);
345345
if (links == null || links.length == 0) {
346346
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
347347
}

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Date;
2323
import java.util.List;
2424
import java.util.Map;
25+
import java.util.regex.Pattern;
2526

2627
import org.appwork.utils.StringUtils;
2728
import org.appwork.utils.parser.UrlQuery;
@@ -47,7 +48,7 @@
4748
import jd.plugins.PluginForDecrypt;
4849
import jd.plugins.hoster.VscoCo;
4950

50-
@DecrypterPlugin(revision = "$Revision: 51384 $", interfaceVersion = 3, names = {}, urls = {})
51+
@DecrypterPlugin(revision = "$Revision: 51420 $", interfaceVersion = 3, names = {}, urls = {})
5152
public class VscoCoCrawler extends PluginForDecrypt {
5253
public VscoCoCrawler(PluginWrapper wrapper) {
5354
super(wrapper);
@@ -86,11 +87,13 @@ public static String[] getAnnotationUrls() {
8687
return buildAnnotationUrls(getPluginDomains());
8788
}
8889

90+
private static final Pattern PATTERN_PROFILE_AND_SINGLE_MEDIA = Pattern.compile("/([\\w-]+)(/(media|video)/([a-f0-9-]{24,}))?", Pattern.CASE_INSENSITIVE);
91+
8992
public static String[] buildAnnotationUrls(final List<String[]> pluginDomains) {
9093
final List<String> ret = new ArrayList<String>();
9194
for (final String[] domains : pluginDomains) {
9295
final String domainsPattern = buildHostsPatternPart(domains);
93-
ret.add("https?://(?:[^/]+\\." + domainsPattern + "/grid/\\d+|(?:www\\.)?" + domainsPattern + "/[\\w-]+/grid/\\d+|(?:www\\.)?" + domainsPattern + "/[\\w-]+(/media/[a-f0-9]{24})?)");
96+
ret.add("https?://(?:[^/]+\\." + domainsPattern + "/grid/\\d+|(?:www\\.)?" + domainsPattern + "/[\\w-]+/grid/\\d+|(?:www\\.)?" + domainsPattern + PATTERN_PROFILE_AND_SINGLE_MEDIA.pattern() + ")");
9497
}
9598
return ret.toArray(new String[0]);
9699
}
@@ -125,10 +128,11 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
125128
/* Prepare json for our parser */
126129
json = json.replace(":undefined", ":null,");
127130
final Map<String, Object> root = JavaScriptEngineFactory.jsonToJavaMap(json);
128-
final String singleImageID = new Regex(br.getURL(), "(?i)https?://[^/]+/[^/]+/media/([a-f0-9]{24})").getMatch(0);
129-
if (singleImageID != null) {
130-
/* Crawl single image */
131-
final Map<String, Object> media = (Map<String, Object>) JavaScriptEngineFactory.walkJson(root, "medias/byId/" + singleImageID + "/media");
131+
/* Check if we are looking for a single media item. */
132+
final String singleMediaID = new Regex(br._getURL().getPath(), PATTERN_PROFILE_AND_SINGLE_MEDIA).getMatch(3);
133+
if (singleMediaID != null) {
134+
/* Crawl single media item */
135+
final Map<String, Object> media = (Map<String, Object>) JavaScriptEngineFactory.walkJson(root, "medias/byId/" + singleMediaID + "/media");
132136
return crawlProcessMediaFirstPage(media, username);
133137
} else {
134138
/* Crawl profile */

svn_trunk/src/jd/plugins/hoster/BangCom.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import jd.plugins.PluginForHost;
5151
import jd.plugins.decrypter.BangComCrawler;
5252

53-
@HostPlugin(revision = "$Revision: 51413 $", interfaceVersion = 3, names = {}, urls = {})
53+
@HostPlugin(revision = "$Revision: 51421 $", interfaceVersion = 3, names = {}, urls = {})
5454
public class BangCom extends PluginForHost {
5555
public BangCom(PluginWrapper wrapper) {
5656
super(wrapper);
@@ -345,13 +345,16 @@ public AccountInfo fetchAccountInfo(final Account account) throws Exception {
345345
ai.setUnlimitedTraffic();
346346
/* 2023-01-31: A public API is available but so far is not of any use for us: https://api.bang.com */
347347
final String userJson = br.getRegex("window\\.user = (\\{.*?\\});\\s").getMatch(0);
348-
boolean isSubscriptionRunning = br.containsHTML(">\\s*Click to cancel");
348+
boolean isSubscriptionRunning = br.containsHTML(">\\s*Click to cancel|/cancel\"");
349349
final boolean isTrialSubscription = br.containsHTML(">\\s*TRIAL");
350350
String email = null;
351351
if (userJson != null) {
352352
final Map<String, Object> user = restoreFromString(userJson, TypeRef.MAP);
353-
final Map<String, Object> accountType = (Map<String, Object>) user.get("accountType");
354-
if (!isSubscriptionRunning && accountType.get("type").toString().equalsIgnoreCase("paid")) {
353+
// final String lastSubscriptionId = user.get("lastSubscriptionId").toString();
354+
/* 2025-09-01: This map does not exist anymore. */
355+
final Map<String, Object> accountTypeMap = (Map<String, Object>) user.get("accountType");
356+
final String accountType = accountTypeMap != null ? accountTypeMap.get("type").toString() : null;
357+
if (!isSubscriptionRunning && "paid".equalsIgnoreCase(accountType)) {
355358
isSubscriptionRunning = true;
356359
}
357360
email = (String) user.get("email");

0 commit comments

Comments
 (0)