Madara: fix app crash and some sources fixes (#1398)
* Madara: fix crash * fix NPE in ImperioDaBritannia * mangalek use LoadMore * update title selector
This commit is contained in:
parent
678c3de899
commit
014ee88bbb
|
@ -2,7 +2,7 @@ plugins {
|
||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 34
|
baseVersionCode = 35
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":lib:cryptoaes"))
|
api(project(":lib:cryptoaes"))
|
||||||
|
|
|
@ -723,7 +723,7 @@ abstract class Madara(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manga Details Selector
|
// Manga Details Selector
|
||||||
open val mangaDetailsSelectorTitle = "div.post-title h3, div.post-title h1"
|
open val mangaDetailsSelectorTitle = "div.post-title h3, div.post-title h1, #manga-title > h1"
|
||||||
open val mangaDetailsSelectorAuthor = "div.author-content > a"
|
open val mangaDetailsSelectorAuthor = "div.author-content > a"
|
||||||
open val mangaDetailsSelectorArtist = "div.artist-content > a"
|
open val mangaDetailsSelectorArtist = "div.artist-content > a"
|
||||||
open val mangaDetailsSelectorStatus = "div.summary-content"
|
open val mangaDetailsSelectorStatus = "div.summary-content"
|
||||||
|
@ -989,8 +989,7 @@ abstract class Madara(
|
||||||
.substringAfter("var manga = ")
|
.substringAfter("var manga = ")
|
||||||
.substringBeforeLast(";")
|
.substringBeforeLast(";")
|
||||||
|
|
||||||
val wpManga = runCatching { json.parseToJsonElement(wpMangaInfo).jsonObject }
|
val wpManga = json.parseToJsonElement(wpMangaInfo).jsonObject
|
||||||
.getOrNull() ?: return null
|
|
||||||
|
|
||||||
if (wpManga["enable_manga_view"]?.jsonPrimitive?.content == "1") {
|
if (wpManga["enable_manga_view"]?.jsonPrimitive?.content == "1") {
|
||||||
val formBuilder = FormBody.Builder()
|
val formBuilder = FormBody.Builder()
|
||||||
|
@ -1007,9 +1006,7 @@ abstract class Madara(
|
||||||
.set("Referer", document.location())
|
.set("Referer", document.location())
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val ajaxUrl = wpManga["ajax_url"]!!.jsonPrimitive.content
|
return POST("$baseUrl/wp-admin/admin-ajax.php", newHeaders, formBody)
|
||||||
|
|
||||||
return POST(ajaxUrl, newHeaders, formBody)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
|
@ -1020,13 +1017,15 @@ abstract class Madara(
|
||||||
*
|
*
|
||||||
* @param document The response document with the wp-manga data
|
* @param document The response document with the wp-manga data
|
||||||
*/
|
*/
|
||||||
protected open fun countViews(document: Document) {
|
protected fun countViews(document: Document) {
|
||||||
if (!sendViewCount) {
|
if (!sendViewCount) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
val request = countViewsRequest(document) ?: return
|
val request = countViewsRequest(document) ?: return
|
||||||
runCatching { client.newCall(request).execute().close() }
|
client.newCall(request).execute().close()
|
||||||
|
} catch (_: Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Mangalek :
|
||||||
ConfigurableSource {
|
ConfigurableSource {
|
||||||
|
|
||||||
override val fetchGenres = false
|
override val fetchGenres = false
|
||||||
|
override val useLoadMoreRequest = LoadMoreStrategy.Always
|
||||||
override val chapterUrlSuffix = ""
|
override val chapterUrlSuffix = ""
|
||||||
|
|
||||||
private val defaultBaseUrl = "https://manga-lek.net"
|
private val defaultBaseUrl = "https://manga-lek.net"
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
|
@ -19,6 +19,5 @@ class ImperioDaBritannia : Madara(
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val useNewChapterEndpoint = true
|
override val useNewChapterEndpoint = true
|
||||||
|
|
||||||
override val mangaDetailsSelectorTag = ""
|
override val mangaDetailsSelectorTag = ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue