From 6657e01284e61b38599c7ac1edb5716f3953a86a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 9 Feb 2024 23:00:55 +0100 Subject: [PATCH] =?utf8?q?=E2=AC=86=EF=B8=8F=20Update=20Jsoup=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../net/pterodactylus/rhynodge/filters/comics/OglafComicSiteFilter.kt | 4 ++-- .../rhynodge/filters/comics/QuestionableContentComicFilter.kt | 2 +- .../rhynodge/filters/comics/SoggyCardboardComicFilter.kt | 2 +- .../rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index e195ee3..55bd153 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ dependencies { compile group: "com.google.guava", name: "guava", version: "14.0-rc1" compile group: "log4j", name: "log4j", version: "1.2.17" compile group: "org.apache.httpcomponents", name: "httpclient", version: "4.4" - compile group: "org.jsoup", name: "jsoup", version: "1.7.1" + compile group: "org.jsoup", name: "jsoup", version: "1.16.1" compile group: "javax.mail", name: "mail", version: "1.4.6-rc1" compile group: "org.apache.commons", name: "commons-lang3", version: "3.1" compile group: "com.fasterxml.jackson.core", name: "jackson-core", version: "2.1.2" diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/OglafComicSiteFilter.kt b/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/OglafComicSiteFilter.kt index 777eca8..c886fca 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/OglafComicSiteFilter.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/OglafComicSiteFilter.kt @@ -9,12 +9,12 @@ class OglafComicSiteFilter : ComicSiteFilter() { override fun extractTitle(document: Document) = document.title().asOptional() override fun extractImageUrls(document: Document) = - document.getElementById("strip") + document.getElementById("strip")!! .attr("src") .let(::listOf) override fun extractImageComments(document: Document) = - document.getElementById("strip") + document.getElementById("strip")!! .attr("title") .let(::listOf) diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/QuestionableContentComicFilter.kt b/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/QuestionableContentComicFilter.kt index 5b56df7..f405839 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/QuestionableContentComicFilter.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/QuestionableContentComicFilter.kt @@ -25,7 +25,7 @@ class QuestionableContentComicFilter : ComicSiteFilter() { override fun extractTitle(document: Document): Optional = Optional.absent() override fun extractImageUrls(document: Document): List = - listOf(document.select("#comicnav").first().nextSibling().nextSibling().attr("src")) + listOf(document.select("#comicnav").first()!!.nextSibling()!!.nextSibling()!!.attr("src")) override fun extractImageComments(document: Document): List = emptyList() diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/SoggyCardboardComicFilter.kt b/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/SoggyCardboardComicFilter.kt index d779a9c..5da7106 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/SoggyCardboardComicFilter.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/SoggyCardboardComicFilter.kt @@ -8,7 +8,7 @@ import org.jsoup.nodes.Document class SoggyCardboardComicFilter : ComicSiteFilter() { override fun extractTitle(document: Document): Optional = - document.select(".ceo_latest_comics_widget li").first().text().asOptional() + document.select(".ceo_latest_comics_widget li").first()!!.text().asOptional() override fun extractImageUrls(document: Document): List = listOf(document.select("#comic img").attr("src")) diff --git a/src/test/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.java b/src/test/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.java index bd32ed2..041838d 100644 --- a/src/test/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.java +++ b/src/test/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.java @@ -36,7 +36,7 @@ public class ChiefOBrienAtWorkComicFilterTest { @Test public void filterCanParseComicTitles() { - MatcherAssert.assertThat(filter.extractTitle(document), Matchers.is(Optional.of("EPISODE 60: Being Human\u00a0"))); + MatcherAssert.assertThat(filter.extractTitle(document), Matchers.is(Optional.of("EPISODE 60: Being Human"))); } } -- 2.7.4