Add new multisrc extension (Weebreader) (#7911)
* Arang Scans: Move to multisrc Weebreader (new) * Weebreader: Add artist and author parsing * Remove Weebreader.kt * Weebreader: Replace weebreader implementation with NaniScan's implementation * Weebreader: Rename classes * Weebreader: Fix typo in filename * Weebreader: Trim whitespace around author and artist
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
|
@ -4,7 +4,7 @@
|
|||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".en.naniscans.NaniScansUrlActivity"
|
||||
android:name=".en.naniscans.WeebreaderUrlActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
<intent-filter>
|
||||
|
@ -12,15 +12,10 @@
|
|||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="naniscans.com"
|
||||
android:host="${SOURCEHOST}"
|
||||
android:pathPattern="/titles/..*"
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="www.naniscans.com"
|
||||
android:pathPattern="/titles/..*"
|
||||
android:scheme="https" />
|
||||
android:scheme="${SOURCESCHEME}" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
@ -0,0 +1,10 @@
|
|||
package eu.kanade.tachiyomi.extension.en.naniscans
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.weebreader.Weebreader
|
||||
|
||||
|
||||
|
||||
|
||||
class NaniScans : Weebreader("NANI? Scans", "https://naniscans.com", "en") {
|
||||
override val versionId = 2
|
||||
}
|
|
@ -34,7 +34,6 @@ class MadaraGenerator : ThemeSourceGenerator {
|
|||
SingleLang("Anisa Manga", "https://anisamanga.com", "tr"),
|
||||
SingleLang("ApollComics", "https://apollcomics.xyz", "es", overrideVersionCode = 1),
|
||||
SingleLang("ArabMkr", "https://arabmkr.me", "ar"),
|
||||
SingleLang("Arang Scans", "https://arangscans.com", "en", overrideVersionCode = 3), // removed override
|
||||
SingleLang("ArazNovel", "https://www.araznovel.com", "tr", overrideVersionCode = 1),
|
||||
SingleLang("Argos Scan", "https://argosscan.com", "pt-BR", overrideVersionCode = 2),
|
||||
SingleLang("Arthur Scan", "https://arthurscan.xyz", "pt-BR", overrideVersionCode = 1),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.extension.en.naniscans
|
||||
package eu.kanade.tachiyomi.multisrc.weebreader
|
||||
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
|
@ -21,18 +21,14 @@ import uy.kohesive.injekt.injectLazy
|
|||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class NaniScans : HttpSource() {
|
||||
|
||||
override val name = "NANI? Scans"
|
||||
|
||||
override val baseUrl = "https://naniscans.com"
|
||||
|
||||
override val lang = "en"
|
||||
abstract class Weebreader(
|
||||
override val name: String,
|
||||
override val baseUrl: String,
|
||||
override val lang: String,
|
||||
): HttpSource() {
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val versionId = 2
|
||||
|
||||
private val dateParser = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
|
@ -98,8 +94,8 @@ class NaniScans : HttpSource() {
|
|||
|
||||
return SManga.create().apply {
|
||||
title = titleJson["name"]!!.jsonPrimitive.content
|
||||
artist = titleJson["artist"]!!.jsonPrimitive.content
|
||||
author = titleJson["author"]!!.jsonPrimitive.content
|
||||
artist = titleJson["artist"]!!.jsonPrimitive.content.trim()
|
||||
author = titleJson["author"]!!.jsonPrimitive.content.trim()
|
||||
description = titleJson["synopsis"]!!.jsonPrimitive.content
|
||||
status = getStatus(titleJson["status"]!!.jsonPrimitive.content)
|
||||
thumbnail_url = "$baseUrl${titleJson["coverUrl"]!!.jsonPrimitive.content}"
|
||||
|
@ -116,8 +112,6 @@ class NaniScans : HttpSource() {
|
|||
if (titleJson["type"]!!.jsonPrimitive.content != "Comic")
|
||||
throw UnsupportedOperationException("Tachiyomi only supports Comics.")
|
||||
|
||||
val chaptersJson = titleJson["chapters"]!!.jsonArray
|
||||
|
||||
return titleJson["chapters"]!!.jsonArray.map {
|
||||
val chapter = it.jsonObject
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package eu.kanade.tachiyomi.multisrc.weebreader
|
||||
|
||||
import generator.ThemeSourceData.SingleLang
|
||||
import generator.ThemeSourceGenerator
|
||||
|
||||
class WeebreaderGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themePkg = "weebreader"
|
||||
|
||||
override val themeClass = "Weebreader"
|
||||
|
||||
override val baseVersionCode: Int = 1
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Arang Scans", "https://arangscans.com", "en", overrideVersionCode = 10),
|
||||
SingleLang("NANI? Scans", "https://naniscans.com", "en", overrideVersionCode = 6, className = "NaniScans"),
|
||||
)
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
WeebreaderGenerator().createAll()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.extension.en.naniscans
|
||||
package eu.kanade.tachiyomi.multisrc.weebreader
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ActivityNotFoundException
|
||||
|
@ -7,7 +7,7 @@ import android.os.Bundle
|
|||
import android.util.Log
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class NaniScansUrlActivity : Activity() {
|
||||
class WeebreaderUrlActivity : Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
|
@ -23,10 +23,10 @@ class NaniScansUrlActivity : Activity() {
|
|||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e("NaniScansUrlActivity", e.toString())
|
||||
Log.e("WeebreaderUrlActivity", e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e("NaniScansUrlActivity", "could not parse uri from intent $intent")
|
||||
Log.e("WeebreaderUrlActivity", "could not parse uri from intent $intent")
|
||||
}
|
||||
|
||||
finish()
|
|
@ -1,13 +0,0 @@
|
|||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlinx-serialization'
|
||||
|
||||
ext {
|
||||
extName = 'NANI? Scans'
|
||||
pkgNameSuffix = 'en.naniscans'
|
||||
extClass = '.NaniScans'
|
||||
extVersionCode = 6
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|