|
28 | 28 | import java.util.Map; |
29 | 29 | import java.util.Map.Entry; |
30 | 30 |
|
| 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 | + |
31 | 52 | import org.appwork.storage.TypeRef; |
32 | 53 | import org.appwork.utils.DebugMode; |
33 | 54 | import org.appwork.utils.Hash; |
|
52 | 73 | import org.jdownloader.plugins.controller.LazyPlugin; |
53 | 74 | import org.jdownloader.scripting.JavaScriptEngineFactory; |
54 | 75 |
|
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" }) |
76 | 77 | public class Ardmediathek extends PluginForDecrypt { |
77 | 78 | /* Constants */ |
78 | 79 | 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 |
857 | 858 | } |
858 | 859 |
|
859 | 860 | /** |
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! |
864 | 864 | */ |
865 | 865 | private ArrayList<DownloadLink> crawlARDMediathekSearchResultsVOD(final String searchTerm, final int maxResults) throws Exception { |
866 | 866 | if (StringUtils.isEmpty(searchTerm)) { |
@@ -978,8 +978,8 @@ private ArrayList<DownloadLink> crawlWdrMediaObject(final CryptedLink param, fin |
978 | 978 | } |
979 | 979 | metadata.setChannel(trackerData.get("trackerClipCategory").toString()); |
980 | 980 | /** |
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! |
983 | 983 | */ |
984 | 984 | // metadata.setContentID(trackerData.get("trackerClipId").toString()); |
985 | 985 | metadata.setRequiresContentIDToBeSet(false); |
@@ -1230,8 +1230,7 @@ private HashMap<String, DownloadLink> crawlARDJson(final CryptedLink param, fina |
1230 | 1230 | } |
1231 | 1231 |
|
1232 | 1232 | /** |
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> |
1235 | 1234 | */ |
1236 | 1235 | private ArrayList<DownloadLink> crawlDasersteVideo(final CryptedLink param) throws Exception { |
1237 | 1236 | br.getPage(param.getCryptedUrl()); |
@@ -1662,7 +1661,10 @@ private ArrayList<DownloadLink> crawlNdrJson(final CryptedLink param, final Brow |
1662 | 1661 | final Map<String, Object> meta = (Map<String, Object>) root.get("meta"); |
1663 | 1662 | String title = (String) meta.get("title"); |
1664 | 1663 | 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 | + } |
1666 | 1668 | if (StringUtils.isEmpty(title)) { |
1667 | 1669 | title = br.getRegex("<meta\\s*name\\s*=\\s*\"title\"\\s*content\\s*=\\s*\"(.*?)\"\\s*/>").getMatch(0); |
1668 | 1670 | } |
|
0 commit comments