From: David ‘Bombe’ Roden Date: Fri, 9 Feb 2024 22:00:55 +0000 (+0100) Subject: ⬆️ Update Jsoup dependency X-Git-Tag: v2~44 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6657e01284e61b38599c7ac1edb5716f3953a86a;p=rhynodge.git ⬆️ Update Jsoup dependency --- 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"))); } }