From 3349cd8a93fa28dfaf3636e649a657f2cceb180b Mon Sep 17 00:00:00 2001
From: pidoubleyou <pidoubleyou@arcor.de>
Date: Sat, 4 Dec 2021 21:10:09 +0100
Subject: [PATCH] kika: additional topic pages

---
 .../java/mServer/crawler/sender/kika/KikaCrawler.java  | 10 ++++++++++
 .../sender/kika/tasks/KikaTopicOverviewPageTask.java   |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/main/java/mServer/crawler/sender/kika/KikaCrawler.java b/src/main/java/mServer/crawler/sender/kika/KikaCrawler.java
index 67e557d1a..9ec87378a 100644
--- a/src/main/java/mServer/crawler/sender/kika/KikaCrawler.java
+++ b/src/main/java/mServer/crawler/sender/kika/KikaCrawler.java
@@ -14,17 +14,26 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.RecursiveTask;
+import java.util.function.Supplier;
 
 public class KikaCrawler extends MediathekCrawler {
   private static final Logger LOG = LogManager.getLogger(KikaCrawler.class);
 
   JsoupConnection jsoupConnection;
 
+  static final Supplier<List<KikaCrawlerUrlDto>> ADDITIONAL_URLS = () -> {
+    List<KikaCrawlerUrlDto> urls1 = new ArrayList<>();
+    urls1.add(new KikaCrawlerUrlDto("https://www.kika.de/bernd-das-brot/bernd-klassiker-videos-100.html", FilmType.NORMAL));
+    return urls1;
+  };
+
   public KikaCrawler(FilmeSuchen ssearch, int startPrio) {
        super(ssearch, Const.KIKA, 0, 1, startPrio);
     jsoupConnection = new JsoupConnection();
@@ -88,6 +97,7 @@ public class KikaCrawler extends MediathekCrawler {
         new KikaTopicLandingPageTask(
             this, new ConcurrentLinkedQueue<>(topicUrls), KikaConstants.BASE_URL, jsoupConnection);
     final Set<KikaCrawlerUrlDto> topicOverviewUrls = forkJoinPool.submit(landingTask).get();
+    topicOverviewUrls.addAll(ADDITIONAL_URLS.get());
 
     final KikaTopicOverviewPageTask topicOverviewTask =
         new KikaTopicOverviewPageTask(
diff --git a/src/main/java/mServer/crawler/sender/kika/tasks/KikaTopicOverviewPageTask.java b/src/main/java/mServer/crawler/sender/kika/tasks/KikaTopicOverviewPageTask.java
index a6f67f27e..545125411 100644
--- a/src/main/java/mServer/crawler/sender/kika/tasks/KikaTopicOverviewPageTask.java
+++ b/src/main/java/mServer/crawler/sender/kika/tasks/KikaTopicOverviewPageTask.java
@@ -70,7 +70,7 @@ public class KikaTopicOverviewPageTask extends AbstractDocumentTask<KikaCrawlerU
 
   private int getMaximumSubpages() {
     if (CrawlerTool.loadLongMax()) {
-      return 3;
+      return 6;
     }
     return 0;
   }
-- 
GitLab