MangaBox: handle URLs that don't share the same domain (closes #1726)

This commit is contained in:
Eugene 2019-10-31 22:44:38 -04:00
parent c1bc1bf6a9
commit d992ba0e6f
No known key found for this signature in database
GPG Key ID: E1FD745328866B0A
2 changed files with 22 additions and 1 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaBox (Mangakakalot and others)'
pkgNameSuffix = 'all.mangabox'
extClass = '.MangaBoxFactory'
extVersionCode = 1
extVersionCode = 2
libVersion = '1.2'
}

View File

@ -124,6 +124,13 @@ abstract class MangaBox (
open val descriptionSelector = "div#noidungm"
override fun mangaDetailsRequest(manga: SManga): Request {
if (manga.url.startsWith("http")) {
return GET(manga.url, headers)
}
return super.mangaDetailsRequest(manga)
}
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
val infoElement = document.select(mangaDetailsMainSelector).first()
@ -146,6 +153,13 @@ abstract class MangaBox (
else -> SManga.UNKNOWN
}
override fun chapterListRequest(manga: SManga): Request {
if (manga.url.startsWith("http")) {
return GET(manga.url, headers)
}
return super.chapterListRequest(manga)
}
override fun chapterListSelector() = "div.chapter-list div.row"
override fun chapterFromElement(element: Element): SChapter {
@ -191,6 +205,13 @@ abstract class MangaBox (
return 0L
}
override fun pageListRequest(chapter: SChapter): Request {
if (chapter.url.startsWith("http")) {
return GET(chapter.url, headers)
}
return super.pageListRequest(chapter)
}
open val pageListSelector = "div#vungdoc img"
override fun pageListParse(document: Document): List<Page> {