parent
691cba4a93
commit
6ff3045c6f
|
@ -16,7 +16,7 @@ over at [Extension FAQ] or [Getting Started].
|
||||||
|
|
||||||
### Why are some chapters missing?
|
### 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
|
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
|
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.
|
your existing account, follow the guide available below.
|
||||||
|
@ -25,7 +25,7 @@ your existing account, follow the guide available below.
|
||||||
|
|
||||||
### Reading subscription-locked chapters
|
### 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.
|
an active paid subscription on their service.
|
||||||
|
|
||||||
> **Warning**
|
> **Warning**
|
||||||
|
|
|
@ -3,10 +3,10 @@ apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlinx-serialization'
|
apply plugin: 'kotlinx-serialization'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
extName = 'VIZ Shonen Jump'
|
extName = 'VIZ'
|
||||||
pkgNameSuffix = 'en.vizshonenjump'
|
pkgNameSuffix = 'en.vizshonenjump'
|
||||||
extClass = '.VizShonenJump'
|
extClass = '.VizFactory'
|
||||||
extVersionCode = 18
|
extVersionCode = 19
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -28,9 +28,10 @@ import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class VizShonenJump : ParsedHttpSource() {
|
open class Viz(
|
||||||
|
final override val name: String,
|
||||||
override val name = "VIZ Shonen Jump"
|
private val servicePath: String,
|
||||||
|
) : ParsedHttpSource() {
|
||||||
|
|
||||||
override val baseUrl = "https://www.viz.com"
|
override val baseUrl = "https://www.viz.com"
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ class VizShonenJump : ParsedHttpSource() {
|
||||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||||
.add("User-Agent", USER_AGENT)
|
.add("User-Agent", USER_AGENT)
|
||||||
.add("Origin", baseUrl)
|
.add("Origin", baseUrl)
|
||||||
.add("Referer", "$baseUrl/shonenjump")
|
.add("Referer", "$baseUrl/$servicePath")
|
||||||
|
|
||||||
private val json: Json by injectLazy()
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
|
@ -62,7 +63,7 @@ class VizShonenJump : ParsedHttpSource() {
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
return GET(
|
return GET(
|
||||||
url = "$baseUrl/read/shonenjump/section/free-chapters",
|
url = "$baseUrl/read/$servicePath/section/free-chapters",
|
||||||
headers = newHeaders,
|
headers = newHeaders,
|
||||||
cache = CacheControl.FORCE_NETWORK,
|
cache = CacheControl.FORCE_NETWORK,
|
||||||
)
|
)
|
||||||
|
@ -115,9 +116,12 @@ class VizShonenJump : ParsedHttpSource() {
|
||||||
|
|
||||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||||
if (query.startsWith(PREFIX_URL_SEARCH)) {
|
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(
|
return fetchMangaDetails(
|
||||||
SManga.create().apply {
|
SManga.create().apply {
|
||||||
this.url = query.substringAfter(PREFIX_URL_SEARCH)
|
this.url = url
|
||||||
this.title = ""
|
this.title = ""
|
||||||
this.initialized = false
|
this.initialized = false
|
||||||
},
|
},
|
||||||
|
@ -224,7 +228,7 @@ class VizShonenJump : ParsedHttpSource() {
|
||||||
override fun pageListRequest(chapter: SChapter): Request {
|
override fun pageListRequest(chapter: SChapter): Request {
|
||||||
val mangaUrl = chapter.url
|
val mangaUrl = chapter.url
|
||||||
.substringBefore("-chapter")
|
.substringBefore("-chapter")
|
||||||
.replace("jump/", "jump/chapters/")
|
.replace("$servicePath/", "$servicePath/chapters/")
|
||||||
|
|
||||||
val newHeaders = headersBuilder()
|
val newHeaders = headersBuilder()
|
||||||
.set("Referer", baseUrl + mangaUrl)
|
.set("Referer", baseUrl + mangaUrl)
|
|
@ -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"),
|
||||||
|
)
|
||||||
|
}
|
|
@ -57,7 +57,7 @@ class VizImageInterceptor : Interceptor {
|
||||||
.add("Accept", "*/*")
|
.add("Accept", "*/*")
|
||||||
.add("Origin", "https://www.viz.com")
|
.add("Origin", "https://www.viz.com")
|
||||||
.add("Referer", "https://www.viz.com/")
|
.add("Referer", "https://www.viz.com/")
|
||||||
.add("User-Agent", VizShonenJump.USER_AGENT)
|
.add("User-Agent", Viz.USER_AGENT)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
return GET(url, headers)
|
return GET(url, headers)
|
||||||
|
|
|
@ -22,7 +22,7 @@ class VizUrlActivity : Activity() {
|
||||||
action = "eu.kanade.tachiyomi.SEARCH"
|
action = "eu.kanade.tachiyomi.SEARCH"
|
||||||
putExtra(
|
putExtra(
|
||||||
"query",
|
"query",
|
||||||
"${VizShonenJump.PREFIX_URL_SEARCH}/${pathSegments[0]}/chapters/$seriesSlug",
|
"${Viz.PREFIX_URL_SEARCH}/${pathSegments[0]}/chapters/$seriesSlug",
|
||||||
)
|
)
|
||||||
putExtra("filter", packageName)
|
putExtra("filter", packageName)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue