Skip to content

Commit 91fb08c

Browse files
author
updating-bot
committed
mirroring bot - 2025/07/15
1 parent 87b7e90 commit 91fb08c

File tree

27 files changed

+519
-292
lines changed

27 files changed

+519
-292
lines changed

svn_trunk/src/jd/plugins/PluginBrowser.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package jd.plugins;
22

3+
import java.util.Map;
4+
35
import jd.http.Browser;
46

7+
import org.appwork.storage.TypeRef;
8+
59
public class PluginBrowser<T extends Plugin> extends Browser {
610

711
private final T plugin;
@@ -20,4 +24,20 @@ public Browser createNewBrowserInstance() {
2024
return getPlugin().createNewBrowserInstance();
2125
}
2226

27+
public Map<String, Object> getVideoObject() {
28+
final String[] ldJSONs = getRegex("<script type\\s*=\\s*\"application/ld\\+json\"[^>]*>\\s*(\\{.*?\\})\\s*</script>").getColumn(0);
29+
for (final String ldJSON : ldJSONs) {
30+
try {
31+
final Map<String, Object> map = getPlugin().restoreFromString(ldJSON, TypeRef.MAP);
32+
// https://schema.org/VideoObject
33+
if (map != null && "VideoObject".equals(map.get("@type"))) {
34+
return map;
35+
}
36+
} catch (Exception e) {
37+
getPlugin().getLogger().log(e);
38+
}
39+
}
40+
return null;
41+
}
42+
2343
}

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

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,27 @@
2828
import java.util.Map;
2929
import java.util.Map.Entry;
3030

31+
import jd.PluginWrapper;
32+
import jd.controlling.ProgressController;
33+
import jd.http.Browser;
34+
import jd.http.URLConnectionAdapter;
35+
import jd.nutils.encoding.Encoding;
36+
import jd.parser.Regex;
37+
import jd.plugins.CryptedLink;
38+
import jd.plugins.DecrypterPlugin;
39+
import jd.plugins.DecrypterRetryException;
40+
import jd.plugins.DecrypterRetryException.RetryReason;
41+
import jd.plugins.DownloadLink;
42+
import jd.plugins.FilePackage;
43+
import jd.plugins.LinkStatus;
44+
import jd.plugins.Plugin;
45+
import jd.plugins.PluginBrowser;
46+
import jd.plugins.PluginException;
47+
import jd.plugins.PluginForDecrypt;
48+
import jd.plugins.components.MediathekHelper;
49+
import jd.plugins.components.PluginJSonUtils;
50+
import jd.plugins.hoster.ARDMediathek;
51+
3152
import org.appwork.storage.TypeRef;
3253
import org.appwork.utils.DebugMode;
3354
import org.appwork.utils.Hash;
@@ -52,27 +73,7 @@
5273
import org.jdownloader.plugins.controller.LazyPlugin;
5374
import org.jdownloader.scripting.JavaScriptEngineFactory;
5475

55-
import jd.PluginWrapper;
56-
import jd.controlling.ProgressController;
57-
import jd.http.Browser;
58-
import jd.http.URLConnectionAdapter;
59-
import jd.nutils.encoding.Encoding;
60-
import jd.parser.Regex;
61-
import jd.plugins.CryptedLink;
62-
import jd.plugins.DecrypterPlugin;
63-
import jd.plugins.DecrypterRetryException;
64-
import jd.plugins.DecrypterRetryException.RetryReason;
65-
import jd.plugins.DownloadLink;
66-
import jd.plugins.FilePackage;
67-
import jd.plugins.LinkStatus;
68-
import jd.plugins.Plugin;
69-
import jd.plugins.PluginException;
70-
import jd.plugins.PluginForDecrypt;
71-
import jd.plugins.components.MediathekHelper;
72-
import jd.plugins.components.PluginJSonUtils;
73-
import jd.plugins.hoster.ARDMediathek;
74-
75-
@DecrypterPlugin(revision = "$Revision: 51153 $", interfaceVersion = 3, names = { "ardmediathek.de", "daserste.de", "sandmann.de", "wdr.de", "sportschau.de", "wdrmaus.de", "eurovision.de", "sputnik.de", "mdr.de", "ndr.de", "tagesschau.de" }, urls = { "https?://(?:\\w+\\.)?ardmediathek\\.de/.+", "https?://(?:\\w+\\.)?daserste\\.de/.*?\\.html", "https?://(?:www\\.)?sandmann\\.de/.+", "https?://(?:\\w+\\.)?wdr\\.de/[^<>\"]+\\.html|https?://deviceids-[a-z0-9\\-]+\\.wdr\\.de/ondemand/\\d+/\\d+\\.js", "https?://(?:\\w+\\.)?sportschau\\.de/.*?\\.html", "https?://(?:\\w+\\.)?wdrmaus\\.de/.+", "https?://(?:\\w+\\.)?eurovision\\.de/[^<>\"]+\\.html", "https?://(?:\\w+\\.)?sputnik\\.de/[^<>\"]+\\.html", "https?://(?:www\\.)?mdr\\.de/[^<>\"]+\\.html", "https?://(?:\\w+\\.)?ndr\\.de/[^<>\"]+\\.html", "https?://(?:\\w+\\.)?tagesschau\\.de/[^<>\"]+\\.html" })
76+
@DecrypterPlugin(revision = "$Revision: 51211 $", interfaceVersion = 3, names = { "ardmediathek.de", "daserste.de", "sandmann.de", "wdr.de", "sportschau.de", "wdrmaus.de", "eurovision.de", "sputnik.de", "mdr.de", "ndr.de", "tagesschau.de" }, urls = { "https?://(?:\\w+\\.)?ardmediathek\\.de/.+", "https?://(?:\\w+\\.)?daserste\\.de/.*?\\.html", "https?://(?:www\\.)?sandmann\\.de/.+", "https?://(?:\\w+\\.)?wdr\\.de/[^<>\"]+\\.html|https?://deviceids-[a-z0-9\\-]+\\.wdr\\.de/ondemand/\\d+/\\d+\\.js", "https?://(?:\\w+\\.)?sportschau\\.de/.*?\\.html", "https?://(?:\\w+\\.)?wdrmaus\\.de/.+", "https?://(?:\\w+\\.)?eurovision\\.de/[^<>\"]+\\.html", "https?://(?:\\w+\\.)?sputnik\\.de/[^<>\"]+\\.html", "https?://(?:www\\.)?mdr\\.de/[^<>\"]+\\.html", "https?://(?:\\w+\\.)?ndr\\.de/[^<>\"]+\\.html", "https?://(?:\\w+\\.)?tagesschau\\.de/[^<>\"]+\\.html" })
7677
public class Ardmediathek extends PluginForDecrypt {
7778
/* Constants */
7879
private static final String type_embedded = "(?i)https?://deviceids-[a-z0-9\\-]+\\.wdr\\.de/ondemand/\\d+/\\d+\\.js";
@@ -857,10 +858,9 @@ private ArrayList<DownloadLink> crawlSportschauDe(final CryptedLink param) throw
857858
}
858859

859860
/**
860-
* Searches for videos in ardmediathek that match the given search term. </br>
861-
* This is mostly used as a workaround to find stuff that is hosted on their other website on ardmediathek instead as ardmediathek is
862-
* providing a fairly stable API while other websites hosting the same content such as sportschau.de can be complicated to parse. </br>
863-
* This does not (yet) support pagination!
861+
* Searches for videos in ardmediathek that match the given search term. </br> This is mostly used as a workaround to find stuff that is
862+
* hosted on their other website on ardmediathek instead as ardmediathek is providing a fairly stable API while other websites hosting
863+
* the same content such as sportschau.de can be complicated to parse. </br> This does not (yet) support pagination!
864864
*/
865865
private ArrayList<DownloadLink> crawlARDMediathekSearchResultsVOD(final String searchTerm, final int maxResults) throws Exception {
866866
if (StringUtils.isEmpty(searchTerm)) {
@@ -978,8 +978,8 @@ private ArrayList<DownloadLink> crawlWdrMediaObject(final CryptedLink param, fin
978978
}
979979
metadata.setChannel(trackerData.get("trackerClipCategory").toString());
980980
/**
981-
* 2022-03-10: Do not use trackerClipId as unique ID as there can be different IDs for the same streams. </br>
982-
* Let the handling go into fallback and use the final downloadurls as unique trait!
981+
* 2022-03-10: Do not use trackerClipId as unique ID as there can be different IDs for the same streams. </br> Let the handling go
982+
* into fallback and use the final downloadurls as unique trait!
983983
*/
984984
// metadata.setContentID(trackerData.get("trackerClipId").toString());
985985
metadata.setRequiresContentIDToBeSet(false);
@@ -1230,8 +1230,7 @@ private HashMap<String, DownloadLink> crawlARDJson(final CryptedLink param, fina
12301230
}
12311231

12321232
/**
1233-
* Handling for older ARD websites. </br>
1234-
* INFORMATION: network = akamai or limelight == RTMP </br>
1233+
* Handling for older ARD websites. </br> INFORMATION: network = akamai or limelight == RTMP </br>
12351234
*/
12361235
private ArrayList<DownloadLink> crawlDasersteVideo(final CryptedLink param) throws Exception {
12371236
br.getPage(param.getCryptedUrl());
@@ -1662,7 +1661,10 @@ private ArrayList<DownloadLink> crawlNdrJson(final CryptedLink param, final Brow
16621661
final Map<String, Object> meta = (Map<String, Object>) root.get("meta");
16631662
String title = (String) meta.get("title");
16641663
if (StringUtils.isEmpty(title)) {
1665-
title = br.getRegex("@type\"\\s*:\\s*\"VideoObject\"\\s*,\\s*\"name\"\\s*:\\s*\"(.*?)\"\\s*,").getMatch(0);
1664+
final Map<String, Object> videoObject = ((PluginBrowser) br).getVideoObject();
1665+
if (videoObject != null) {
1666+
title = (String) videoObject.get("name");
1667+
}
16661668
if (StringUtils.isEmpty(title)) {
16671669
title = br.getRegex("<meta\\s*name\\s*=\\s*\"title\"\\s*content\\s*=\\s*\"(.*?)\"\\s*/>").getMatch(0);
16681670
}

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

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
import java.util.List;
2323
import java.util.Map;
2424

25-
import org.appwork.storage.TypeRef;
26-
import org.appwork.utils.StringUtils;
27-
import org.jdownloader.plugins.components.config.BangComConfig;
28-
import org.jdownloader.plugins.config.PluginJsonConfig;
29-
import org.jdownloader.plugins.controller.LazyPlugin;
30-
3125
import jd.PluginWrapper;
3226
import jd.controlling.AccountController;
3327
import jd.controlling.ProgressController;
@@ -43,12 +37,19 @@
4337
import jd.plugins.FilePackage;
4438
import jd.plugins.LinkStatus;
4539
import jd.plugins.Plugin;
40+
import jd.plugins.PluginBrowser;
4641
import jd.plugins.PluginDependencies;
4742
import jd.plugins.PluginException;
4843
import jd.plugins.PluginForDecrypt;
4944
import jd.plugins.hoster.BangCom;
5045

51-
@DecrypterPlugin(revision = "$Revision: 49889 $", interfaceVersion = 3, names = {}, urls = {})
46+
import org.appwork.storage.TypeRef;
47+
import org.appwork.utils.StringUtils;
48+
import org.jdownloader.plugins.components.config.BangComConfig;
49+
import org.jdownloader.plugins.config.PluginJsonConfig;
50+
import org.jdownloader.plugins.controller.LazyPlugin;
51+
52+
@DecrypterPlugin(revision = "$Revision: 51211 $", interfaceVersion = 3, names = {}, urls = {})
5253
@PluginDependencies(dependencies = { BangCom.class })
5354
public class BangComCrawler extends PluginForDecrypt {
5455
public BangComCrawler(PluginWrapper wrapper) {
@@ -189,16 +190,7 @@ public <QualitySelectionMode> ArrayList<DownloadLink> crawlVideo(String url, fin
189190
if (account != null && br.containsHTML(">\\s*No unlocks")) {
190191
account.setError(AccountError.EXPIRED, 3 * 60 * 1000, "Expired trial account (no unlocks left)");
191192
}
192-
Map<String, Object> videoObject = null;
193-
final String[] jsSnippets = br.getRegex("<script type=\"application/ld\\+json\">(.*?)</script>").getColumn(0);
194-
for (final String jsSnippet : jsSnippets) {
195-
final Map<String, Object> entries = restoreFromString(jsSnippet, TypeRef.MAP);
196-
final String type = (String) entries.get("@type");
197-
if (StringUtils.equalsIgnoreCase(type, "VideoObject")) {
198-
videoObject = entries;
199-
break;
200-
}
201-
}
193+
final Map<String, Object> videoObject = ((PluginBrowser) br).getVideoObject();
202194
if (videoObject == null) {
203195
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
204196
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import jd.plugins.DownloadLink;
3535
import jd.plugins.FilePackage;
3636
import jd.plugins.LinkStatus;
37+
import jd.plugins.PluginBrowser;
3738
import jd.plugins.PluginException;
3839
import jd.plugins.PluginForDecrypt;
3940
import jd.plugins.components.IgnVariant;
@@ -45,7 +46,7 @@
4546
import org.w3c.dom.Node;
4647
import org.w3c.dom.NodeList;
4748

48-
@DecrypterPlugin(revision = "$Revision: 48641 $", interfaceVersion = 3, names = {}, urls = {})
49+
@DecrypterPlugin(revision = "$Revision: 51211 $", interfaceVersion = 3, names = {}, urls = {})
4950
public class IgnCom extends PluginForDecrypt {
5051
public IgnCom(PluginWrapper wrapper) {
5152
super(wrapper);
@@ -120,14 +121,13 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
120121
// final String json = br.getRegex("data-video=\\'(\\{.*?\\})\\'[\t\n\r ]+").getMatch(0);
121122
// final String json = br.getRegex("data-settings=\"(\\{.*?\\})\"[\t\n\r ]+").getMatch(0);
122123
// String json = br.getRegex("video&quot;:(\\{.*?\\})\"[\t\n\r ]+").getMatch(0);
123-
final String json_single_video = br.getRegex("<script type=\"application/ld\\+json\">([^<]*VideoObject[^>]*)</script>").getMatch(0);
124+
final Map<String, Object> json_single_video = ((PluginBrowser) br).getVideoObject();
124125
final String json = br.getRegex("<script id=\"__NEXT_DATA__\" type=\"application/json\">(.*?)</script>").getMatch(0);
125126
if (json == null && json_single_video == null) {
126127
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
127128
}
128-
Map<String, Object> entries = null;
129129
if (json_single_video != null) {
130-
entries = (Map<String, Object>) JavaScriptEngineFactory.jsonToJavaObject(json_single_video);
130+
final Map<String, Object> entries = json_single_video;
131131
final String embedURL = (String) entries.get("embedUrl");
132132
final String directurl = (String) entries.get("contentUrl");
133133
String fileTitle = (String) entries.get("name");
@@ -148,7 +148,7 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
148148
}
149149
} else {
150150
// json = Encoding.htmlDecode(json);
151-
entries = (Map<String, Object>) JavaScriptEngineFactory.jsonToJavaObject(json);
151+
Map<String, Object> entries = (Map<String, Object>) JavaScriptEngineFactory.jsonToJavaObject(json);
152152
entries = (Map<String, Object>) JavaScriptEngineFactory.walkJson(entries, "props/pageProps");
153153
final Object videoO = entries.get("video");
154154
if (videoO == null) {

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121

22+
import org.jdownloader.plugins.controller.LazyPlugin;
23+
2224
import jd.PluginWrapper;
2325
import jd.controlling.ProgressController;
2426
import jd.http.Browser;
@@ -33,9 +35,7 @@
3335
import jd.plugins.PluginForDecrypt;
3436
import jd.plugins.components.PluginJSonUtils;
3537

36-
import org.jdownloader.plugins.controller.LazyPlugin;
37-
38-
@DecrypterPlugin(revision = "$Revision: 51200 $", interfaceVersion = 2, names = {}, urls = {})
38+
@DecrypterPlugin(revision = "$Revision: 51210 $", interfaceVersion = 2, names = {}, urls = {})
3939
public class JavhdToday extends PluginForDecrypt {
4040
public JavhdToday(PluginWrapper wrapper) {
4141
super(wrapper);
@@ -71,7 +71,7 @@ public static String[] getAnnotationUrls() {
7171
public static String[] buildAnnotationUrls(final List<String[]> pluginDomains) {
7272
final List<String> ret = new ArrayList<String>();
7373
for (final String[] domains : pluginDomains) {
74-
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "/(?!blogs).+");
74+
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "/\\d+/[\\w-]+/");
7575
}
7676
return ret.toArray(new String[0]);
7777
}
@@ -82,7 +82,9 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
8282
final String contenturl = param.getCryptedUrl();
8383
br.setFollowRedirects(true);
8484
br.getPage(contenturl);
85-
if (br.getHttpConnection().getResponseCode() == 404 || br.containsHTML("404 Not Found\\s*<|Page not found")) {
85+
if (br.getHttpConnection().getResponseCode() == 404) {
86+
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
87+
} else if (br.containsHTML("404 Not Found\\s*<|Page not found")) {
8688
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
8789
}
8890
final String urlSlug = new Regex(br.getURL(), "/([\\w-]+)/?$").getMatch(0);

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@
2929
import jd.plugins.DownloadLink;
3030
import jd.plugins.FilePackage;
3131
import jd.plugins.LinkStatus;
32+
import jd.plugins.PluginBrowser;
3233
import jd.plugins.PluginException;
3334
import jd.plugins.PluginForDecrypt;
3435
import jd.plugins.hoster.DirectHTTP;
3536

3637
import org.appwork.storage.TypeRef;
3738
import org.appwork.utils.StringUtils;
3839

39-
@DecrypterPlugin(revision = "$Revision: 51116 $", interfaceVersion = 3, names = {}, urls = {})
40+
@DecrypterPlugin(revision = "$Revision: 51211 $", interfaceVersion = 3, names = {}, urls = {})
4041
public class KikaDeCrawler extends PluginForDecrypt {
4142
public KikaDeCrawler(PluginWrapper wrapper) {
4243
super(wrapper);
@@ -106,7 +107,10 @@ public ArrayList<DownloadLink> decryptIt(final CryptedLink param, ProgressContro
106107
}
107108
String title = br.getRegex("<title>([^<]+)</title>").getMatch(0);
108109
if (title == null) {
109-
title = br.getRegex("\"VideoObject\",\"name\":\"([^\"]+)\"").getMatch(0);
110+
final Map<String, Object> videoObject = ((PluginBrowser) br).getVideoObject();
111+
if (videoObject != null) {
112+
title = (String) videoObject.get("name");
113+
}
110114
}
111115
if (title == null) {
112116
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import jd.plugins.LinkStatus;
5757
import jd.plugins.PluginException;
5858

59-
@HostPlugin(revision = "$Revision: 51195 $", interfaceVersion = 3, names = {}, urls = {})
59+
@HostPlugin(revision = "$Revision: 51210 $", interfaceVersion = 3, names = {}, urls = {})
6060
public class DoodstreamCom extends XFileSharingProBasic {
6161
public DoodstreamCom(final PluginWrapper wrapper) {
6262
super(wrapper);
@@ -603,11 +603,18 @@ protected String getDllinkViaOfficialVideoDownload(final Browser brc, final Down
603603
return null;
604604
}
605605
/* 2022-07-08: 5 seconds of pre-download-wait is skippable */
606-
final boolean skipWaittime = true;
606+
final boolean skipWaittime = false;
607607
if (!skipWaittime) {
608-
this.waitTime(link, Time.systemIndependentCurrentJVMTimeMillis());
609-
logger.info("Waiting extra wait seconds: " + getDllinkViaOfficialVideoDownloadExtraWaittimeSeconds());
610-
this.sleep(getDllinkViaOfficialVideoDownloadExtraWaittimeSeconds() * 1000l, link);
608+
final String waitSecondsStr = brc.getRegex("id=\"seconds\"[^>]*>(\\d{1,2})<").getMatch(0);
609+
if (waitSecondsStr == null) {
610+
logger.warning("Failed to find pre download wait time -> Fallback to default");
611+
this.waitTime(link, Time.systemIndependentCurrentJVMTimeMillis());
612+
logger.info("Waiting extra wait seconds: " + getDllinkViaOfficialVideoDownloadExtraWaittimeSeconds());
613+
this.sleep(getDllinkViaOfficialVideoDownloadExtraWaittimeSeconds() * 1000l, link);
614+
} else {
615+
final int waitSeconds = Integer.parseInt(waitSecondsStr);
616+
this.sleep(waitSeconds * 1001l, link);
617+
}
611618
}
612619
getPage(brc, continueURL);
613620
/* 2019-08-29: This Form may sometimes be given e.g. deltabit.co */

0 commit comments

Comments
 (0)