* Viz Manga

* update readme
This commit is contained in:
AwkwardPeak7 2023-07-03 01:39:17 +05:00 committed by GitHub
parent 691cba4a93
commit 6ff3045c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 14 deletions

View File

@ -16,7 +16,7 @@ over at [Extension FAQ] or [Getting Started].
### Why are some chapters missing?
VIZ Shonen Jump is a paid subscription-based service and you need an active monthly subscription to
**VIZ Shonen Jump** and **VIZ Manga** are paid subscription-based services and you need an active monthly subscription to
be able to read most of the chapters available in their service. These locked chapters will be
filtered out from the chapter list by default if you're not signed in. To sign in with
your existing account, follow the guide available below.
@ -25,7 +25,7 @@ your existing account, follow the guide available below.
### Reading subscription-locked chapters
The **VIZ Shonen Jump** sources allows the reading of paid chapters if you have
The **VIZ** sources allows the reading of paid chapters if you have
an active paid subscription on their service.
> **Warning**

View File

@ -3,10 +3,10 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'
ext {
extName = 'VIZ Shonen Jump'
extName = 'VIZ'
pkgNameSuffix = 'en.vizshonenjump'
extClass = '.VizShonenJump'
extVersionCode = 18
extClass = '.VizFactory'
extVersionCode = 19
}
dependencies {

View File

@ -28,9 +28,10 @@ import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class VizShonenJump : ParsedHttpSource() {
override val name = "VIZ Shonen Jump"
open class Viz(
final override val name: String,
private val servicePath: String,
) : ParsedHttpSource() {
override val baseUrl = "https://www.viz.com"
@ -48,7 +49,7 @@ class VizShonenJump : ParsedHttpSource() {
override fun headersBuilder(): Headers.Builder = Headers.Builder()
.add("User-Agent", USER_AGENT)
.add("Origin", baseUrl)
.add("Referer", "$baseUrl/shonenjump")
.add("Referer", "$baseUrl/$servicePath")
private val json: Json by injectLazy()
@ -62,7 +63,7 @@ class VizShonenJump : ParsedHttpSource() {
.build()
return GET(
url = "$baseUrl/read/shonenjump/section/free-chapters",
url = "$baseUrl/read/$servicePath/section/free-chapters",
headers = newHeaders,
cache = CacheControl.FORCE_NETWORK,
)
@ -115,9 +116,12 @@ class VizShonenJump : ParsedHttpSource() {
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
if (query.startsWith(PREFIX_URL_SEARCH)) {
val url = query.substringAfter(PREFIX_URL_SEARCH)
val service = url.split("/")[1]
if (service != servicePath) return Observable.just(MangasPage(emptyList(), false))
return fetchMangaDetails(
SManga.create().apply {
this.url = query.substringAfter(PREFIX_URL_SEARCH)
this.url = url
this.title = ""
this.initialized = false
},
@ -224,7 +228,7 @@ class VizShonenJump : ParsedHttpSource() {
override fun pageListRequest(chapter: SChapter): Request {
val mangaUrl = chapter.url
.substringBefore("-chapter")
.replace("jump/", "jump/chapters/")
.replace("$servicePath/", "$servicePath/chapters/")
val newHeaders = headersBuilder()
.set("Referer", baseUrl + mangaUrl)

View File

@ -0,0 +1,10 @@
package eu.kanade.tachiyomi.extension.en.vizshonenjump
import eu.kanade.tachiyomi.source.SourceFactory
class VizFactory : SourceFactory {
override fun createSources() = listOf(
Viz("VIZ Shonen Jump", "shonenjump"),
Viz("VIZ Manga", "vizmanga"),
)
}

View File

@ -57,7 +57,7 @@ class VizImageInterceptor : Interceptor {
.add("Accept", "*/*")
.add("Origin", "https://www.viz.com")
.add("Referer", "https://www.viz.com/")
.add("User-Agent", VizShonenJump.USER_AGENT)
.add("User-Agent", Viz.USER_AGENT)
.build()
return GET(url, headers)

View File

@ -22,7 +22,7 @@ class VizUrlActivity : Activity() {
action = "eu.kanade.tachiyomi.SEARCH"
putExtra(
"query",
"${VizShonenJump.PREFIX_URL_SEARCH}/${pathSegments[0]}/chapters/$seriesSlug",
"${Viz.PREFIX_URL_SEARCH}/${pathSegments[0]}/chapters/$seriesSlug",
)
putExtra("filter", packageName)
}