Check if Mangahere manga is licensed (#1275)
This commit is contained in:
parent
e68870cc29
commit
dd2fb8a9a6
|
@ -5,12 +5,14 @@ ext {
|
||||||
appName = 'Tachiyomi: Mangahere'
|
appName = 'Tachiyomi: Mangahere'
|
||||||
pkgNameSuffix = 'en.mangahere'
|
pkgNameSuffix = 'en.mangahere'
|
||||||
extClass = '.Mangahere'
|
extClass = '.Mangahere'
|
||||||
extVersionCode = 9
|
extVersionCode = 10
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly project(':duktape-stub')
|
compileOnly project(':duktape-stub')
|
||||||
|
sourceCompatibility = "1.6"
|
||||||
|
targetCompatibility = "1.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.squareup.duktape.Duktape
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.source.model.*
|
import eu.kanade.tachiyomi.source.model.*
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import okhttp3.*
|
import okhttp3.*
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
@ -147,6 +148,11 @@ class Mangahere : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get a chapter, check if the manga is licensed.
|
||||||
|
val aChapterURL = chapterFromElement(document.select(chapterListSelector()).first()).url
|
||||||
|
val aChapterDocument = client.newCall(GET("$baseUrl$aChapterURL", headers)).execute().asJsoup()
|
||||||
|
if (aChapterDocument.select("p.detail-block-content").hasText()) manga.status = SManga.LICENSED
|
||||||
|
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue