diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt index 2d4adb76..60fa95a5 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/grouple/GroupleParser.kt @@ -214,7 +214,6 @@ internal abstract class GroupleParser( cachedPagesServer = it.toHttpUrlOrNull()?.host } } catch (e: NoSuchElementException) { - assert(false) { e.toString() } candidates.randomOrNull() ?: throw ParseException("No page url candidates", page.url, e) } } @@ -314,7 +313,7 @@ internal abstract class GroupleParser( private suspend fun tryHead(url: String): Boolean = runCatchingCancellable { webClient.httpHead(url).use { response -> - response.isSuccessful && response.headersContentLength() >= MIN_IMAGE_SIZE + response.isSuccessful && !response.isPumpkin() && response.headersContentLength() >= MIN_IMAGE_SIZE } }.getOrDefault(false) @@ -326,6 +325,8 @@ internal abstract class GroupleParser( return this } + private fun Response.isPumpkin(): Boolean = request.url.host == "upload.wikimedia.org" + private fun parseManga(node: Element): Manga? { val imgDiv = node.selectFirst("div.img") ?: return null val descDiv = node.selectFirst("div.desc") ?: return null