From ac4759cfa5c4a31ac21987ba727aaba9ef5adfd7 Mon Sep 17 00:00:00 2001 From: pidoubleyou Date: Sat, 7 May 2022 21:49:59 +0200 Subject: [PATCH 1/4] additional log --- src/main/java/mServer/crawler/sender/arte/ArteHttpClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/mServer/crawler/sender/arte/ArteHttpClient.java b/src/main/java/mServer/crawler/sender/arte/ArteHttpClient.java index d87e05520..367f9a0f0 100644 --- a/src/main/java/mServer/crawler/sender/arte/ArteHttpClient.java +++ b/src/main/java/mServer/crawler/sender/arte/ArteHttpClient.java @@ -81,6 +81,7 @@ public static T executeRequest(final String sender, Logger logger, Gson gson } else { if (response.code() != 429) { logger.error(String.format("ARTE Request '%s' failed: %s", aUrl, response.code())); + Log.sysLog(String.format("ARTE Request '%s' failed: %s", aUrl, response.code())); FilmeSuchen.listeSenderLaufen.inc(sender, RunSender.Count.FEHLER); stop = true; } else { From 8d08b37f3de070a16699d5cc45233b0b42bbc13f Mon Sep 17 00:00:00 2001 From: pidoubleyou Date: Sat, 7 May 2022 21:53:47 +0200 Subject: [PATCH 2/4] replace removed api /v1/config with opa videostreams --- .../ArteProgramIdToDatenFilmCallable.java | 4 +- .../sender/arte/ArteVideoDeserializer.java | 40 ++++--------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/src/main/java/mServer/crawler/sender/arte/ArteProgramIdToDatenFilmCallable.java b/src/main/java/mServer/crawler/sender/arte/ArteProgramIdToDatenFilmCallable.java index 0d40f23e7..2a307bd4e 100644 --- a/src/main/java/mServer/crawler/sender/arte/ArteProgramIdToDatenFilmCallable.java +++ b/src/main/java/mServer/crawler/sender/arte/ArteProgramIdToDatenFilmCallable.java @@ -25,7 +25,7 @@ public class ArteProgramIdToDatenFilmCallable implements Callable private static final Logger LOG = LogManager.getLogger(ArteProgramIdToDatenFilmCallable.class); - private static final String ARTE_VIDEO_INFORMATION_URL_PATTERN = "https://api.arte.tv/api/player/v1/config/%s/%s?platform=ARTE_NEXT"; + private static final String ARTE_VIDEO_INFORMATION_URL_PATTERN = "https://api.arte.tv/api/opa/v3/videoStreams?programId=%s&mediaType=mp4&limit=100&language=%s"; private static final String ARTE_VIDEO_INFORMATION_URL_PATTERN_2 = "https://api.arte.tv/api/opa/v3/programs/%s/%s"; // Für broadcastBeginRounded private final FastDateFormat broadcastDateFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ssX");//2016-10-29T16:15:00Z @@ -52,7 +52,7 @@ public Set call() throws Exception { .registerTypeAdapter(ArteVideoDetailsDTO.class, new ArteVideoDetailsDeserializer(today)) .create(); - String videosUrl = String.format(ARTE_VIDEO_INFORMATION_URL_PATTERN, langCode, programId); + String videosUrl = String.format(ARTE_VIDEO_INFORMATION_URL_PATTERN, programId, langCode); ArteVideoDTO video = ArteHttpClient.executeRequest(senderName, LOG, gson, videosUrl, ArteVideoDTO.class); if (video != null) { diff --git a/src/main/java/mServer/crawler/sender/arte/ArteVideoDeserializer.java b/src/main/java/mServer/crawler/sender/arte/ArteVideoDeserializer.java index 952908286..238b78d08 100644 --- a/src/main/java/mServer/crawler/sender/arte/ArteVideoDeserializer.java +++ b/src/main/java/mServer/crawler/sender/arte/ArteVideoDeserializer.java @@ -1,30 +1,22 @@ package mServer.crawler.sender.arte; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; +import com.google.gson.*; import mServer.crawler.sender.base.Qualities; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.lang.reflect.Type; -import java.time.Duration; -import java.util.Map; import java.util.Optional; -import java.util.Set; public class ArteVideoDeserializer implements JsonDeserializer { private static final Logger LOG = LogManager.getLogger(ArteVideoDeserializer.class); - private static final String JSON_OBJECT_KEY_PLAYER = "videoJsonPlayer"; - private static final String JSON_OBJECT_KEY_VSR = "VSR"; - private static final String ATTRIBUTE_DURATION = "videoDurationSeconds"; + private static final String JSON_OBJECT_KEY_PLAYER = "videoStreams"; private static final String ATTRIBUTE_URL = "url"; private static final String ATTRIBUTE_QUALITY = "quality"; - private static final String ATTRIBUTE_VERSION_CODE = "versionCode"; + private static final String ATTRIBUTE_VERSION_CODE = "audioCode"; private final String sender; @@ -38,29 +30,13 @@ public ArteVideoDTO deserialize( ArteVideoDTO arteVideoDTO = new ArteVideoDTO(); if (aJsonElement.isJsonObject() && aJsonElement.getAsJsonObject().has(JSON_OBJECT_KEY_PLAYER) - && aJsonElement.getAsJsonObject().get(JSON_OBJECT_KEY_PLAYER).isJsonObject() - && aJsonElement - .getAsJsonObject() - .get(JSON_OBJECT_KEY_PLAYER) - .getAsJsonObject() - .has(JSON_OBJECT_KEY_VSR) - && aJsonElement - .getAsJsonObject() - .get(JSON_OBJECT_KEY_PLAYER) - .getAsJsonObject() - .get(JSON_OBJECT_KEY_VSR) - .isJsonObject()) { - JsonObject playerObject = - aJsonElement.getAsJsonObject().get(JSON_OBJECT_KEY_PLAYER).getAsJsonObject(); - JsonObject vsrJsonObject = playerObject.get(JSON_OBJECT_KEY_VSR).getAsJsonObject(); + && aJsonElement.getAsJsonObject().get(JSON_OBJECT_KEY_PLAYER).isJsonArray()) { + JsonArray videoStreams = + aJsonElement.getAsJsonObject().get(JSON_OBJECT_KEY_PLAYER).getAsJsonArray(); - final long duration = playerObject.has(ATTRIBUTE_DURATION) ? playerObject.get(ATTRIBUTE_DURATION).getAsLong() : 0; - arteVideoDTO.setDuration(Duration.ofSeconds(duration)); - - final Set> entries = vsrJsonObject.entrySet(); - entries.forEach( + videoStreams.forEach( entry -> { - final JsonObject value = entry.getValue().getAsJsonObject(); + final JsonObject value = entry.getAsJsonObject(); final String code = value.get(ATTRIBUTE_VERSION_CODE).getAsString(); final String quality = value.get(ATTRIBUTE_QUALITY).getAsString(); From 238ea8a6c98b8d98463da6da7036d05bf2da51a1 Mon Sep 17 00:00:00 2001 From: pidoubleyou Date: Sat, 7 May 2022 22:16:59 +0200 Subject: [PATCH 3/4] deactivate foreign languages to monitor duration of long run --- src/main/java/mServer/crawler/sender/arte/MediathekArte.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/mServer/crawler/sender/arte/MediathekArte.java b/src/main/java/mServer/crawler/sender/arte/MediathekArte.java index 53acacc9a..ca206a5c6 100644 --- a/src/main/java/mServer/crawler/sender/arte/MediathekArte.java +++ b/src/main/java/mServer/crawler/sender/arte/MediathekArte.java @@ -91,13 +91,13 @@ protected synchronized void meldungStart() { senderLanguages.put(Const.ARTE_DE, "de"); senderLanguages.put(Const.ARTE_FR, "fr"); - if (LocalDate.now().getDayOfYear() % 2 == 0) { + /*if (LocalDate.now().getDayOfYear() % 2 == 0) { senderLanguages.put(ARTE_EN, "en"); senderLanguages.put(ARTE_ES, "es"); } else { senderLanguages.put(ARTE_IT, "it"); senderLanguages.put(ARTE_PL, "pl"); - } + }*/ // starte Sprachen Sender, da es sonst zu doppelten Sendern kommen kann senderLanguages.keySet().forEach(sender -> mlibFilmeSuchen.melden(sender, getMax(), getProgress(), "")); From 709d48e49f66eada7e45c9b4589ee5e025698adf Mon Sep 17 00:00:00 2001 From: Alexander F Date: Sat, 7 May 2022 22:32:28 +0200 Subject: [PATCH 4/4] Version auf 3.1.194 angehoben --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0a914edc9..28589e6b9 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 group = 'de.mediathekview' archivesBaseName = "MServer" -version = '3.1.193' +version = '3.1.194' def jarName = 'MServer.jar' def mainClass = 'mServer.Main'