Added Guya multisrc (#6861)

* Update Guya.kt

* Deleted old files

* Added Guya multisrc

* Added Overrides

* Update version
This commit is contained in:
Johannes Joens 2021-05-06 22:11:15 +12:00 committed by GitHub
parent 9a45dc2f8e
commit 807f2c8a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 132 additions and 18 deletions

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.kanade.tachiyomi.extension">
<application>
<activity
android:name=".en.dankefurslesen.DankeFursLesenUrlActivity"
android:excludeFromRecents="true"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="danke.moe"
android:pathPattern="/read/manga/..*"
android:scheme="https" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,11 @@
package eu.kanade.tachiyomi.extension.en.dankefurslesen
import eu.kanade.tachiyomi.multisrc.guya.Guya
class DankeFursLesen : Guya("Danke fürs Lesen", "https://danke.moe", "en") {
companion object {
const val SLUG_PREFIX = "slug:"
const val PROXY_PREFIX = "proxy:"
const val NESTED_PROXY_API_PREFIX = "/proxy/api/"
}
}

View File

@ -0,0 +1,57 @@
package eu.kanade.tachiyomi.extension.en.dankefurslesen
import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.util.Log
import kotlin.system.exitProcess
/**
* Accepts https://danke.moe/read/manga/xyz intents
*
* Added due to requests from various users to allow for opening of titles when given the
* Guya URL whilst on mobile.
*/
class DankeFursLesenUrlActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val host = intent?.data?.host
val pathSegments = intent?.data?.pathSegments
if (host != null && pathSegments != null) {
val query = fromDankeFursLesen(pathSegments)
if (query == null) {
Log.e("DankeFursLesenUrlActivity", "Unable to parse URI from intent $intent")
finish()
exitProcess(1)
}
val mainIntent = Intent().apply {
action = "eu.kanade.tachiyomi.SEARCH"
putExtra("query", query)
putExtra("filter", packageName)
}
try {
startActivity(mainIntent)
} catch (e: ActivityNotFoundException) {
Log.e("DankeFursLesenUrlActivity", e.toString())
}
}
finish()
exitProcess(0)
}
private fun fromDankeFursLesen(pathSegments: MutableList<String>): String? {
return if (pathSegments.size >= 3) {
val slug = pathSegments[2]
"${DankeFursLesen.SLUG_PREFIX}$slug"
} else {
null
}
}
}

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View File

@ -0,0 +1,11 @@
package eu.kanade.tachiyomi.extension.en.guya
import eu.kanade.tachiyomi.multisrc.guya.Guya
class Guya : Guya("Guya", "https://guya.moe", "en"){
companion object {
const val SLUG_PREFIX = "slug:"
const val PROXY_PREFIX = "proxy:"
const val NESTED_PROXY_API_PREFIX = "/proxy/api/"
}
}

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.extension.en.guya
package eu.kanade.tachiyomi.multisrc.guya
import android.app.Application
import android.content.SharedPreferences
@ -25,12 +25,12 @@ import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.HashMap
open class Guya : ConfigurableSource, HttpSource() {
abstract class Guya(
override val name: String,
override val baseUrl: String,
override val lang: String) : ConfigurableSource, HttpSource() {
final override val name = "Guya"
final override val baseUrl = "https://guya.moe"
final override val supportsLatest = false
final override val lang = "en"
override val supportsLatest = false
private val scanlatorCacheUrl = "$baseUrl/api/get_all_groups"

View File

@ -0,0 +1,24 @@
package eu.kanade.tachiyomi.multisrc.guya
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class GuyaGenerator : ThemeSourceGenerator {
override val themePkg = "guya"
override val themeClass = "Guya"
override val baseVersionCode: Int = 1
override val sources = listOf(
SingleLang("Guya", "https://guya.moe", "en", overrideVersionCode = 18),
SingleLang("Danke fürs Lesen", "https://danke.moe", "en", className = "DankeFursLesen"),
)
companion object {
@JvmStatic
fun main(args: Array<String>) {
GuyaGenerator().createAll()
}
}
}

View File

@ -1,12 +0,0 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'Guya'
pkgNameSuffix = "en.guya"
extClass = '.Guya'
extVersionCode = 18
libVersion = '1.2'
}
apply from: "$rootDir/common.gradle"