Skip to content

Commit 8f94022

Browse files
author
updating-bot
committed
mirroring bot - 2024/12/18
1 parent b9e6fc6 commit 8f94022

32 files changed

+609
-384
lines changed

svn_browser/src/jd/http/Browser.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ private static void waitForPageAccess(final Browser browser, final Request reque
640640
private String acceptLanguage = "de, en-gb;q=0.9, en;q=0.8";
641641
/*
642642
* -1 means use default Timeouts
643-
*
643+
*
644644
* 0 means infinite (DO NOT USE if not needed)
645645
*/
646646
private int connectTimeout = -1;
@@ -964,7 +964,7 @@ public PostFormDataRequest createPostFormDataRequest(String url) throws IOExcept
964964
/**
965965
* Creates a new postrequest based an an requestVariable ArrayList
966966
*
967-
* @deprecated use {@link #createPostRequest(String, UrlQuery, String)
967+
* @deprecated use {@link #createPostRequest(String, UrlQuery, String)
968968
*
969969
*
970970
*/
@@ -2609,7 +2609,7 @@ protected static CloudflareBlockedType getCloudflareBlock(Browser browser, Reque
26092609
} else {
26102610
// final boolean isCloudflareHeaderCfRayExistent = req.getResponseHeader("cf-ray") != null;
26112611
final boolean isCloudflareServer = StringUtils.containsIgnoreCase(request.getResponseHeader(HTTPConstants.HEADER_RESPONSE_SERVER), "cloudflare");
2612-
final boolean isTypicalCloudflareResponseCode = con.getResponseCode() == 403 || con.getResponseCode() == 502 || con.getResponseCode() == 503 || con.getResponseCode() == 429 || con.getResponseCode() == 522;
2612+
final boolean isTypicalCloudflareResponseCode = con.getResponseCode() == 403 || con.getResponseCode() == 502 || con.getResponseCode() == 503 || con.getResponseCode() == 429 || con.getResponseCode() == 522 || con.getResponseCode() == 523;
26132613
// TODO: Add better Cloudflare detection (more/better html snippets)
26142614
// TODO: Add separate BlockedType for Cloudflare-Captcha, see: https://svn.jdownloader.org/issues/90281
26152615
/**
@@ -2635,7 +2635,7 @@ protected static CloudflareBlockedType getCloudflareBlock(Browser browser, Reque
26352635
}
26362636
}
26372637
/* 2023-06-06: This is only a text output. Do not use the errormessage/text for anything else at this moment!! */
2638-
final String errorText = request.getRegex("<h1>([^<]+)</h1>").getMatch(0);
2638+
final String errorText = request.getRegex("<h1[^>]*>\\s*(.*?)\\s*</h1>").getMatch(0);
26392639
browser.getLogger().info("Cloudflare parsed errormessage: " + errorText);
26402640
if (errorCode != null) {
26412641
if (errorCode.matches("5\\d{2}")) {
@@ -3138,8 +3138,8 @@ public BlockedTypeInterface isBlocked(Browser browser, Request request) {
31383138
return null;
31393139
}
31403140
if (true) { /*
3141-
* TODO: Add header based detection too -> At least check "server" header so we do not only rely on html code.
3142-
*/
3141+
* TODO: Add header based detection too -> At least check "server" header so we do not only rely on html code.
3142+
*/
31433143
/* See new ESET NOD32 html code 2023: https://board.jdownloader.org/showthread.php?t=91433 */
31443144
return null;
31453145
} else if (request.containsHTML("<div class\\s*=\\s*\"prodhead\">\\s*<div class\\s*=\\s*\"logoimg\">\\s*<span class\\s*=\\s*\"logotxt\">\\s*ESET NOD32 Antivirus\\s*</span>\\s*</div>\\s*</div>") && request.containsHTML("- ESET NOD32 Antivirus\\s*</title>")) {

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

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
import java.io.IOException;
1919
import java.text.SimpleDateFormat;
2020
import java.util.ArrayList;
21+
import java.util.Arrays;
2122
import java.util.Date;
23+
import java.util.HashSet;
2224
import java.util.List;
2325
import java.util.Locale;
2426
import java.util.Map;
@@ -43,17 +45,19 @@
4345
import jd.plugins.components.PluginJSonUtils;
4446
import jd.plugins.hoster.BbcCom;
4547

46-
@DecrypterPlugin(revision = "$Revision: 48660 $", interfaceVersion = 3, names = { "bbc.com" }, urls = { "https?://(?:www\\.)?(?:bbc\\.com|bbc\\.co\\.uk)/.+" })
48+
@DecrypterPlugin(revision = "$Revision: 50353 $", interfaceVersion = 3, names = { "bbc.com" }, urls = { "https?://(?:www\\.)?(?:bbc\\.com|bbc\\.co\\.uk)/.+" })
4749
public class BbcComDecrypter extends PluginForDecrypt {
4850
public BbcComDecrypter(PluginWrapper wrapper) {
4951
super(wrapper);
5052
}
5153

52-
private final String TYPE_EMBED = "(?i)https?://[^/]+/[^/]+/av-embeds/.+";
53-
private static final String TYPE_PROGRAMMES = "(?i)https?://[^/]+/programmes/([^/]+)$";
54+
private final String TYPE_EMBED = "(?i)https?://[^/]+/[^/]+/av-embeds/.+";
55+
private static final String TYPE_PROGRAMMES = "(?i)https?://[^/]+/programmes/([^/]+)$";
56+
private final HashSet<String> globaldupes = new HashSet<String>();
5457

5558
@SuppressWarnings("unchecked")
5659
public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressController progress) throws Exception {
60+
globaldupes.clear();
5761
ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
5862
br.setFollowRedirects(true);
5963
br.getPage(param.getCryptedUrl());
@@ -375,14 +379,16 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
375379
}
376380
}
377381
/* 2024-02-12: works for e.g. https://www.bbc.co.uk/archive/the-great-egg-race--eggmobiles/zbrvmfr */
378-
final String[] jsons20240212 = br.getRegex("Morph\\.setPayload\\('([^']+)', \\(\\{\"\\);").getColumn(0);
379-
if (jsons20240212 != null && jsons20240212.length > 0) {
380-
for (final String json : jsons20240212) {
381-
final Map<String, Object> map20240212 = restoreFromString(json, TypeRef.MAP);
382-
findVideoMapsDownloadLinkList20240212(ret, map20240212);
383-
}
384-
}
385-
if (this.br.getURL().matches(TYPE_PROGRAMMES)) {
382+
final HashSet<String> jsons_all = new HashSet<String>();
383+
final String[] jsons2024_02_12 = br.getRegex("Morph\\.setPayload\\('([^']+)', \\(\\{\"\\);").getColumn(0);
384+
jsons_all.addAll(Arrays.asList(jsons2024_02_12));
385+
final String[] jsons_2024_12_17 = br.getRegex("type=\"application/json\">(.*?)</script>").getColumn(0);
386+
jsons_all.addAll(Arrays.asList(jsons_2024_12_17));
387+
for (final String json : jsons_all) {
388+
final Object object = restoreFromString(json, TypeRef.OBJECT);
389+
findVideoMapsDownloadLinkList20240212(ret, object);
390+
}
391+
if (br.getURL().matches(TYPE_PROGRAMMES)) {
386392
if (ret.isEmpty()) {
387393
ret.addAll(crawlProgrammes(br.getURL()));
388394
}
@@ -500,13 +506,20 @@ private void findVideoMapsList202308(final ArrayList<Map<String, Object>> hits,
500506
}
501507
}
502508

503-
private void findVideoMapsDownloadLinkList20240212(final ArrayList<DownloadLink> results, final Object o) {
509+
private void findVideoMapsDownloadLinkList20240212(final List<DownloadLink> results, final Object o) {
504510
if (o instanceof Map) {
505511
final Map<String, Object> entrymap = (Map<String, Object>) o;
506-
final Object duration = entrymap.get("duration");
512+
// final Object versions = entrymap.get("versions");
513+
Object duration = entrymap.get("duration");
514+
if (duration == null) {
515+
duration = JavaScriptEngineFactory.walkJson(entrymap, "versions/{0}/duration");
516+
}
507517
final String title = (String) entrymap.get("title");
508-
final String vpid = entrymap.get("vpid").toString();
509-
if (duration != null && title != null && vpid != null) {
518+
String vpid = (String) entrymap.get("vpid");
519+
if (vpid == null) {
520+
vpid = (String) JavaScriptEngineFactory.walkJson(entrymap, "versions/{0}/versionId");
521+
}
522+
if (duration != null && title != null && vpid != null && globaldupes.add(vpid)) {
510523
/* Hit :) */
511524
final DownloadLink dl = this.generateDownloadlink(vpid);
512525
dl.setContentUrl(br.getURL());

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

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import jd.plugins.PluginForHost;
4848
import jd.plugins.hoster.TeraboxCom;
4949

50-
@DecrypterPlugin(revision = "$Revision: 50348 $", interfaceVersion = 3, names = {}, urls = {})
50+
@DecrypterPlugin(revision = "$Revision: 50353 $", interfaceVersion = 3, names = {}, urls = {})
5151
public class TeraboxComFolder extends PluginForDecrypt {
5252
public TeraboxComFolder(PluginWrapper wrapper) {
5353
super(wrapper);
@@ -228,6 +228,7 @@ public ArrayList<DownloadLink> crawlFolder(final Plugin callingPlugin, final Cry
228228
surl = newSurlValue;
229229
}
230230
}
231+
String share_username = null;
231232
int page = 1;
232233
final int maxItemsPerPage = 20;
233234
final UrlQuery queryFolder = new UrlQuery();
@@ -273,7 +274,7 @@ public ArrayList<DownloadLink> crawlFolder(final Plugin callingPlugin, final Cry
273274
boolean captchaRequired = false;
274275
int count = 0;
275276
final int maxTries = 10;
276-
do {
277+
passwordloop: do {
277278
count += 1;
278279
logger.info("Captcha/password attempt " + count + " / " + maxTries);
279280
/*
@@ -304,15 +305,15 @@ public ArrayList<DownloadLink> crawlFolder(final Plugin callingPlugin, final Cry
304305
errno = ((Number) entries.get("errno")).intValue();
305306
passwordCookie = (String) entries.get("randsk");
306307
if (!StringUtils.isEmpty(passwordCookie)) {
307-
break;
308+
/* User has entered correct password */
309+
logger.info("Password loop: Success");
310+
break passwordloop;
311+
} else if (count >= maxTries) {
312+
logger.info("Password loop: Giving up");
313+
break passwordloop;
308314
} else {
309-
if (count >= maxTries) {
310-
logger.info("Giving up");
311-
break;
312-
} else {
313-
logger.info("Wrong password or captcha");
314-
continue;
315-
}
315+
logger.info("Password loop: Wrong password or captcha");
316+
continue passwordloop;
316317
}
317318
} while (!this.isAbort());
318319
if (passwordCookie == null) {
@@ -344,6 +345,32 @@ public ArrayList<DownloadLink> crawlFolder(final Plugin callingPlugin, final Cry
344345
logger.info("Stopping because: Current page doesn't contain any items");
345346
break;
346347
}
348+
if (preGivenPath == null && share_username == null) {
349+
/* This request is solely to find the "share_username". */
350+
final UrlQuery query_shorturlinfo = new UrlQuery();
351+
query_shorturlinfo.add("app_id", getAppID());
352+
query_shorturlinfo.add("web", "1");
353+
query_shorturlinfo.add("channel", getChannel());
354+
query_shorturlinfo.add("clienttype", getClientType());
355+
/* 2023-06-21: jstoken is mandatory when account is given. */
356+
query_shorturlinfo.add("jsToken", jstoken != null ? jstoken : "");
357+
query_shorturlinfo.add("dp-logid", "");
358+
query_shorturlinfo.add("shorturl", "1" + surl);
359+
if (!StringUtils.isEmpty(preGivenPath)) {
360+
query_shorturlinfo.add("dir", preGivenPath);
361+
} else {
362+
query_shorturlinfo.add("root", "1");
363+
}
364+
query_shorturlinfo.add("scene", "");
365+
br.getPage(protocolAndSubdomain + "/api/shorturlinfo?" + query_shorturlinfo.toString());
366+
final Map<String, Object> entries2 = restoreFromString(br.getRequest().getHtmlCode(), TypeRef.MAP);
367+
final int fcount = ((Number) entries2.get("fcount")).intValue();
368+
if (fcount == 0) {
369+
/* Empty folder */
370+
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
371+
}
372+
share_username = entries2.get("share_username").toString();
373+
}
347374
for (final Map<String, Object> ressource : ressourcelist) {
348375
final String path = (String) ressource.get("path");
349376
/* 2021-04-14: 'category' is represented as a String. */
@@ -396,7 +423,7 @@ public ArrayList<DownloadLink> crawlFolder(final Plugin callingPlugin, final Cry
396423
dl.setProperty(TeraboxCom.PROPERTY_ACCOUNT_JS_TOKEN, jstoken);
397424
/* This can be useful to refresh directurls a lot quicker. */
398425
dl.setProperty(TeraboxCom.PROPERTY_PAGINATION_PAGE, page);
399-
if (realpath.length() > 1) {
426+
if (realpath.length() > 0) {
400427
dl.setRelativeDownloadFolderPath(realpath);
401428
final FilePackage fp = FilePackage.getInstance();
402429
fp.setName(realpath);
@@ -405,7 +432,12 @@ public ArrayList<DownloadLink> crawlFolder(final Plugin callingPlugin, final Cry
405432
/* No path or folder title known but we still know that all files should go into one package. */
406433
final FilePackage fp = FilePackage.getInstance();
407434
// fp.setPackageKey(this.getHost() + "://folder/" + surl);
408-
fp.setName(surl);
435+
if (share_username != null) {
436+
/* Mimic title from browser */
437+
fp.setName("Sharing from " + share_username);
438+
} else {
439+
fp.setName(surl);
440+
}
409441
dl._setFilePackage(fp);
410442
}
411443
if (targetFileID == null) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import org.jdownloader.plugins.config.PluginJsonConfig;
4343
import org.jdownloader.plugins.controller.LazyPlugin;
4444

45-
@HostPlugin(revision = "$Revision: 50231 $", interfaceVersion = 2, names = { "beeg.com" }, urls = { "https?://(?:www\\.)?beeg\\.com/-?\\d+(?:\\?t=\\d+-\\d+)?|https?://beta\\.beeg\\.com/-\\d+(?:\\?t=\\d+-\\d+)?" })
45+
@HostPlugin(revision = "$Revision: 50352 $", interfaceVersion = 2, names = { "beeg.com" }, urls = { "https?://(?:www\\.|beta\\.)?beeg\\.com/-\\d+(?:\\?t=\\d+-\\d+)?" })
4646
public class BeegCom extends PluginForHost {
4747
private String dllink[] = null;
4848

@@ -66,7 +66,7 @@ public int getMaxSimultanFreeDownloadNum() {
6666
}
6767

6868
private static final String TYPE_BETA = "https?://beta\\.beeg\\.com/-(\\d+)(?:\\?t=(\\d+-\\d+))?";
69-
private static final String TYPE_NORMAL = "https?://beeg\\.com/-?(\\d+)(?:\\?t=(\\d+-\\d+))?";
69+
private static final String TYPE_NORMAL = "https?://beeg\\.com/-(\\d+)(?:\\?t=(\\d+-\\d+))?";
7070
private boolean server_issue = false;
7171
private static final String PROPERTY_IS_HLS = "is_hls";
7272
private static final String PROPERTY_QUALITY = "what_quality";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
import org.jdownloader.plugins.components.XFileSharingProBasic;
5656
import org.jdownloader.scripting.JavaScriptEngineFactory;
5757

58-
@HostPlugin(revision = "$Revision: 50268 $", interfaceVersion = 3, names = {}, urls = {})
58+
@HostPlugin(revision = "$Revision: 50352 $", interfaceVersion = 3, names = {}, urls = {})
5959
public class DoodstreamCom extends XFileSharingProBasic {
6060
public DoodstreamCom(final PluginWrapper wrapper) {
6161
super(wrapper);
@@ -75,7 +75,7 @@ public DoodstreamCom(final PluginWrapper wrapper) {
7575
public static List<String[]> getPluginDomains() {
7676
final List<String[]> ret = new ArrayList<String[]>();
7777
// each entry in List<String[]> will result in one PluginForHost, Plugin.getHost() will return String[0]->main domain
78-
ret.add(new String[] { "dood.re", "doods.pro", "dood.so", "doodstream.com", "dood.to", "doodapi.com", "dood.watch", "dood.cx", "doodstream.co", "dood.la", "dood.ws", "dood.pm", "dood.sh", "dood.one", "dood.tech", "dood.wf", "dood.yt", "dooood.com", "ds2play.com", "ds2video.com", "d0o0d.com", "do0od.com", "d0000d.com", "d000d.com", "dood.li" });
78+
ret.add(new String[] { "dood.re", "doods.pro", "dood.so", "doodstream.com", "dood.to", "doodapi.com", "dood.watch", "dood.cx", "doodstream.co", "dood.la", "dood.ws", "dood.pm", "dood.sh", "dood.one", "dood.tech", "dood.wf", "dood.yt", "dooood.com", "ds2play.com", "ds2video.com", "d0o0d.com", "do0od.com", "d0000d.com", "d000d.com", "dood.li", "dood.work" });
7979
ret.add(new String[] { "poophd.com", "do0d.co", "pooop.online", "poop.com.co" });
8080
return ret;
8181
}

0 commit comments

Comments
 (0)