diff --git a/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java b/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java index 370c73308..1ad84f51e 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java @@ -93,7 +93,7 @@ private static Optional parseDuration(final Document aDocument) { } final ChronoUnit unitValue = unit.get(); - if (unitValue == ChronoUnit.MINUTES) { + if (unitValue == ChronoUnit.SECONDS || unitValue == ChronoUnit.MINUTES) { return Optional.of( Duration.ofMinutes(Long.parseLong(parts[0])).plusSeconds(Long.parseLong(parts[1]))); } @@ -112,6 +112,9 @@ private static Optional determineChronoUnit(final String aDuration) if (aDuration.contains("Std.")) { return Optional.of(ChronoUnit.HOURS); } + if (aDuration.contains("Sek.")) { + return Optional.of(ChronoUnit.SECONDS); + } return Optional.empty(); } diff --git a/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTest.java b/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTest.java index 17da6eb54..555772290 100644 --- a/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTest.java +++ b/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTest.java @@ -1,5 +1,9 @@ package de.mediathekview.mserver.crawler.orf.tasks; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; + import de.mediathekview.mlib.daten.Film; import de.mediathekview.mlib.daten.GeoLocations; import de.mediathekview.mlib.daten.Sender; @@ -7,23 +11,18 @@ import de.mediathekview.mserver.crawler.orf.OrfCrawler; import de.mediathekview.mserver.testhelper.AssertFilm; import de.mediathekview.mserver.testhelper.JsoupMock; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.io.IOException; import java.time.Duration; import java.time.LocalDateTime; import java.util.Arrays; import java.util.Collection; import java.util.Set; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; @RunWith(Parameterized.class) public class OrfFilmDetailTaskTest extends OrfFilmDetailTaskTestBase { @@ -174,6 +173,24 @@ public static Collection data() { "", "", new GeoLocations[] {GeoLocations.GEO_NONE} + }, + { + "https://tvthek.orf.at/profile/Burgenland-heute-kompakt/13891025/Burgenland-heute-kompakt/14203644", + "/orf/orf_film_with_seconds.html", + "Burgenland heute kompakt", + "Burgenland heute kompakt", + "Burgenland heute kompakt", + LocalDateTime.of(2023, 12, 1, 16, 57, 0), + Duration.ofSeconds(49), + "", + "", + "https://apasfiis.sf.apa.at/ipad/cms-worldwide/2023-12-01_1657_tl_23_Burgenland-heut_____14203644__o__1338501503__s15520121_1__BLBHD_16570412P_16575304P_Q4A.mp4/playlist.m3u8", + "https://apasfiis.sf.apa.at/ipad/cms-worldwide/2023-12-01_1657_tl_23_Burgenland-heut_____14203644__o__1338501503__s15520121_1__BLBHD_16570412P_16575304P_Q6A.mp4/playlist.m3u8", + "https://apasfiis.sf.apa.at/ipad/cms-worldwide/2023-12-01_1657_tl_23_Burgenland-heut_____14203644__o__1338501503__s15520121_1__BLBHD_16570412P_16575304P_Q8C.mp4/playlist.m3u8", + "", + "", + "", + new GeoLocations[] {GeoLocations.GEO_NONE} } }); } diff --git a/src/test/resources/orf/orf_film_with_seconds.html b/src/test/resources/orf/orf_film_with_seconds.html new file mode 100644 index 000000000..2df6d1b34 --- /dev/null +++ b/src/test/resources/orf/orf_film_with_seconds.html @@ -0,0 +1,256 @@ + + + + + Burgenland heute kompakt vom 01.12.2023 um 16:57 Uhr – ORF-TVthek + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+

Ihr Browser hat die automatische Wiedergabe von Videos deaktiviert.

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Regionales | Burgenland heute kompakt

+

Burgenland heute kompakt

+

+
+
+ +
+
+ +
+
+ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + +
+
+
+
+ + + \ No newline at end of file