mirror of
https://github.com/yuzono/anime-extensions.git
synced 2026-06-13 13:39:44 +00:00
Refactor UrlActivities to pass raw URLs (#390)
* refactor UrlActivities (keiyoushi/extensions-source#15620) * Comicaso (theme): Pass raw URL via UrlActivity * GalleryAdults (theme): Pass raw URL via UrlActivity * GroupLe (theme): Pass raw URL via UrlActivity * Guya (theme): Pass raw URL via UrlActivity * HeanCms (theme): Pass raw URL via UrlActivity * LibGroup (theme): Pass raw URL via UrlActivity * Madara (theme): Pass raw URL via UrlActivity * MangAdventure (theme): Pass raw URL via UrlActivity * MangaThemesia (theme): Pass raw URL via UrlActivity * Monochrome (theme): Pass raw URL via UrlActivity * PeachScan (theme): Pass raw URL via UrlActivity * YuYu (theme): Pass raw URL via UrlActivity * Akuma: Pass raw URL via UrlActivity * Comikey: Pass raw URL via UrlActivity * DeviantArt: Pass raw URL via UrlActivity * GlobalComix: Pass raw URL via UrlActivity * Kiutaku: Pass raw URL via UrlActivity * SchaleNetwork: Pass raw URL via UrlActivity * Luscious: Pass raw URL via UrlActivity * MangaDex: Pass raw URL via UrlActivity * MangaPlus: Pass raw URL via UrlActivity * MangaPlus Creators: Pass raw URL via UrlActivity * MangaUp: Pass raw URL via UrlActivity * NamiComi: Pass raw URL via UrlActivity * PandaChaika: Pass raw URL via UrlActivity * Project Suki: Pass raw URL via UrlActivity * Simply Cosplay: Pass raw URL via UrlActivity * Taddy INK: Pass raw URL via UrlActivity * Webtoons: Pass raw URL via UrlActivity * Xinmeitulu: Pass raw URL via UrlActivity * AllManga (EN): Pass raw URL via UrlActivity * Cutie Comics (EN): Pass raw URL via UrlActivity * HentaiHere (EN): Pass raw URL via UrlActivity * HentaiNexus (EN): Pass raw URL via UrlActivity * K Manga (EN): Pass raw URL via UrlActivity * LikeManga (EN): Pass raw URL via UrlActivity * MyHentaiGallery (EN): Pass raw URL via UrlActivity * NineHentai (EN): Pass raw URL via UrlActivity * Oppai Stream (EN): Pass raw URL via UrlActivity * VIZ (EN): Pass raw URL via UrlActivity * Weeb Central (EN): Pass raw URL via UrlActivity * HentaiMode (ES): Pass raw URL via UrlActivity * BigSolo (FR): Pass raw URL via UrlActivity * MangaNova (FR): Pass raw URL via UrlActivity * ScanR (FR): Pass raw URL via UrlActivity * DreamTeams Scans (ID): Pass raw URL via UrlActivity * Hachiraw (JA): Pass raw URL via UrlActivity * Twi4 (JA): Pass raw URL via UrlActivity * Brasil Hentai (PT): Pass raw URL via UrlActivity * ExHentai.net.br (PT): Pass raw URL via UrlActivity * Taiyō (PT): Pass raw URL via UrlActivity * Tao Sect (PT): Pass raw URL via UrlActivity * ZettaHQ (PT): Pass raw URL via UrlActivity * Desu (RU): Pass raw URL via UrlActivity * MangaBuff (RU): Pass raw URL via UrlActivity * UniComics (RU): Pass raw URL via UrlActivity * Hattori Manga (TR): Pass raw URL via UrlActivity * LXManga (VI): Pass raw URL via UrlActivity * MiMi (VI): Pass raw URL via UrlActivity * Baozi Manhua (ZH): Pass raw URL via UrlActivity * Jinman Tiantang (ZH): Pass raw URL via UrlActivity * Komiic (ZH): Pass raw URL via UrlActivity * Kuaikanmanhua (ZH): Pass raw URL via UrlActivity * Mangabz (ZH): Pass raw URL via UrlActivity * ManHuaGui (ZH): Pass raw URL via UrlActivity * Tencent Comics (ZH): Pass raw URL via UrlActivity (cherry picked from commit a5b371d34fbb6b50897c522e262e3a51306f47e2) (cherry picked from commit 61e14a600f40ce7b5e2f3f519d08f91fe080f8ac) (cherry picked from commit bcf64b2fa90ba8d8d18492b78a209d5e240d0618) * Check search URL host against PREF_DOMAIN_DEFAULT instead of baseUrl --------- Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com>
This commit is contained in:
@@ -4,4 +4,4 @@ plugins {
|
||||
alias(kei.plugins.multisrc)
|
||||
}
|
||||
|
||||
baseVersionCode = 3
|
||||
baseVersionCode = 4
|
||||
|
||||
@@ -27,6 +27,7 @@ import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
@@ -102,13 +103,25 @@ abstract class AnimeStream(
|
||||
override fun latestUpdatesNextPageSelector(): String? = searchAnimeNextPageSelector()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByPathParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val path = url.pathSegments.takeIf { it.isNotEmpty() }?.joinToString("/")
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$path", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByPathParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
protected open fun searchAnimeByPathParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -13,22 +13,17 @@ class AnimeStreamUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.isNotEmpty()) {
|
||||
val path = pathSegments.joinToString("/")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AnimeStream.PREFIX_SEARCH}$path")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -4,4 +4,4 @@ plugins {
|
||||
alias(kei.plugins.multisrc)
|
||||
}
|
||||
|
||||
baseVersionCode = 3
|
||||
baseVersionCode = 4
|
||||
|
||||
@@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -177,13 +178,27 @@ abstract class DooPlay(
|
||||
return AnimesPage(animes, hasNextPage)
|
||||
}
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path", headers))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByPathParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
if (url.pathSegments.size < 2) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val path = "${url.pathSegments[0]}/${url.pathSegments[1]}"
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$path", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$path", headers))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByPathParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request = when {
|
||||
|
||||
@@ -13,24 +13,17 @@ class DooPlayUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val path = pathSegments[0]
|
||||
val slug = pathSegments[1]
|
||||
val searchQuery = "$path/$slug"
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${DooPlay.PREFIX_SEARCH}$searchQuery")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Debrid Index'
|
||||
extClass = '.DebridIndex'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
||||
@@ -16,22 +16,17 @@ class DebirdIndexUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${DebridIndex.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
@@ -71,6 +72,23 @@ class DebridIndex :
|
||||
override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used")
|
||||
override fun latestUpdatesParse(response: Response): AnimesPage = throw Exception("Not used")
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$id", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return super.getSearchAnime(page, id, filters)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val tokenKey = preferences.getString(PREF_TOKEN_KEY, null)
|
||||
val debridProvider = preferences.getString(PREF_DEBRID_KEY, "RealDebrid")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Hentai Torrent (Torrent)'
|
||||
extClass = '.HentaiTorrent'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isTorrent = true
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.torrentutils.TorrentUtils
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -64,16 +65,26 @@ class HentaiTorrent :
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element): SAnime = throw UnsupportedOperationException()
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -138,7 +149,7 @@ class HentaiTorrent :
|
||||
scanlator = convertBytesToReadable(file.size)
|
||||
}
|
||||
}.reversed()
|
||||
} catch (e: SocketTimeoutException) {
|
||||
} catch (_: SocketTimeoutException) {
|
||||
throw Exception("Dead Torrent \uD83D\uDE35")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,22 +17,17 @@ class HentaiTorrentUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${HentaiTorrent.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Jav Guru'
|
||||
extClass = '.JavGuru'
|
||||
extVersionCode = 40
|
||||
extVersionCode = 41
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,15 @@ class JavGuru :
|
||||
}
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(0)?.takeIf(String::isNotBlank)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_ID$id", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_ID)) {
|
||||
val id = query.substringAfter(PREFIX_ID)
|
||||
if (id.toIntOrNull() == null) {
|
||||
@@ -130,7 +139,9 @@ class JavGuru :
|
||||
val anime = it.apply { this.url = url }
|
||||
AnimesPage(listOf(anime), false)
|
||||
}
|
||||
} else if (query.isNotEmpty()) {
|
||||
}
|
||||
|
||||
if (query.isNotEmpty()) {
|
||||
return client.newCall(searchAnimeRequest(page, query, filters))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeParse)
|
||||
|
||||
@@ -10,22 +10,17 @@ import kotlin.system.exitProcess
|
||||
class JavGuruUrlActivity : Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val id = pathSegments[0]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${JavGuru.PREFIX_ID}$id")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e("JavGuruUrlActivity", e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e("JavGuruUrlActivity", "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e("JavGuruUrlActivity", "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Nyaa (Torrent)'
|
||||
extClass = '.NyaaFactory'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isTorrent = true
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import eu.kanade.tachiyomi.torrentutils.TorrentUtils
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -78,13 +79,23 @@ class NyaaTorrent(extName: String, private val extURL: String, private val extId
|
||||
override fun latestUpdatesNextPageSelector(): String = animeNextPageSelector
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$id", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -179,7 +190,7 @@ class NyaaTorrent(extName: String, private val extURL: String, private val extId
|
||||
}
|
||||
}.reversed()
|
||||
.toMutableList()
|
||||
} catch (e: SocketTimeoutException) {
|
||||
} catch (_: SocketTimeoutException) {
|
||||
throw Exception("Dead Torrent \uD83D\uDE35")
|
||||
}
|
||||
}
|
||||
@@ -195,9 +206,9 @@ class NyaaTorrent(extName: String, private val extURL: String, private val extId
|
||||
val gigabytes = megabytes / 1024.0
|
||||
|
||||
return when {
|
||||
gigabytes >= 1 -> String.format("%.2f GB", gigabytes)
|
||||
megabytes >= 1 -> String.format("%.2f MB", megabytes)
|
||||
else -> String.format("%.2f KB", kilobytes)
|
||||
gigabytes >= 1 -> String.format(Locale.ROOT, "%.2f GB", gigabytes)
|
||||
megabytes >= 1 -> String.format(Locale.ROOT, "%.2f MB", megabytes)
|
||||
else -> String.format(Locale.ROOT, "%.2f KB", kilobytes)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,22 +17,17 @@ class NyaaTorrentUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${NyaaTorrent.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'PTorrent (Torrent)'
|
||||
extClass = '.PTorrent'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isTorrent = true
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.torrentutils.TorrentUtils
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -64,16 +65,28 @@ class PTorrent :
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element): SAnime = throw UnsupportedOperationException()
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -138,7 +151,7 @@ class PTorrent :
|
||||
scanlator = convertBytesToReadable(file.size)
|
||||
}
|
||||
}.reversed()
|
||||
} catch (e: SocketTimeoutException) {
|
||||
} catch (_: SocketTimeoutException) {
|
||||
throw Exception("Dead Torrent \uD83D\uDE35")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,22 +17,17 @@ class PTorrentUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${PTorrent.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'RouVideo'
|
||||
extClass = '.RouVideoFactory'
|
||||
extVersionCode = 12
|
||||
extVersionCode = 13
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -155,6 +155,18 @@ class RouVideo(
|
||||
// =============================== Search ===============================
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val type = url.pathSegments.getOrNull(0)
|
||||
?: throw Exception("Unsupported url")
|
||||
val item = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$type:$item", filters)
|
||||
}
|
||||
|
||||
// Handle direct ID search (no need for tag/hot search fetching)
|
||||
if (query.startsWith(PREFIX_ID)) {
|
||||
val id = query.removePrefix(PREFIX_ID)
|
||||
|
||||
@@ -17,24 +17,17 @@ class RouVideoUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val type = pathSegments[0]
|
||||
val item = pathSegments[1]
|
||||
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "$type:$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'SupJav'
|
||||
extClass = '.SupJavFactory'
|
||||
extVersionCode = 27
|
||||
extVersionCode = 28
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -68,16 +69,26 @@ class SupJav(override val lang: String = "en") :
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element): SAnime = throw UnsupportedOperationException()
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val path = url.pathSegments.takeIf { it.isNotEmpty() }?.joinToString("/")
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$path", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,22 +17,17 @@ class SupJavUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments ?: return
|
||||
if (pathSegments.isNotEmpty()) {
|
||||
val path = pathSegments.joinToString("/")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${SupJav.PREFIX_SEARCH}$path")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Torrentio (Torrent / Debrid)'
|
||||
extClass = '.Torrentio'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ import keiyoushi.utils.applicationContext
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import keiyoushi.utils.toJsonRequestBody
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
@@ -65,37 +65,37 @@ class Torrentio :
|
||||
}
|
||||
|
||||
// ============================== JustWatch Api Query ======================
|
||||
private fun justWatchQuery(): String = """
|
||||
private fun justWatchQuery(): String = $$"""
|
||||
query GetPopularTitles(
|
||||
${"$"}country: Country!,
|
||||
${"$"}first: Int!,
|
||||
${"$"}language: Language!,
|
||||
${"$"}offset: Int,
|
||||
${"$"}searchQuery: String,
|
||||
${"$"}packages: [String!]!,
|
||||
${"$"}objectTypes: [ObjectType!]!,
|
||||
${"$"}popularTitlesSortBy: PopularTitlesSorting!,
|
||||
${"$"}releaseYear: IntFilter
|
||||
$country: Country!,
|
||||
$first: Int!,
|
||||
$language: Language!,
|
||||
$offset: Int,
|
||||
$searchQuery: String,
|
||||
$packages: [String!]!,
|
||||
$objectTypes: [ObjectType!]!,
|
||||
$popularTitlesSortBy: PopularTitlesSorting!,
|
||||
$releaseYear: IntFilter
|
||||
) {
|
||||
popularTitles(
|
||||
country: ${"$"}country
|
||||
first: ${"$"}first
|
||||
offset: ${"$"}offset
|
||||
sortBy: ${"$"}popularTitlesSortBy
|
||||
country: $country
|
||||
first: $first
|
||||
offset: $offset
|
||||
sortBy: $popularTitlesSortBy
|
||||
filter: {
|
||||
objectTypes: ${"$"}objectTypes,
|
||||
searchQuery: ${"$"}searchQuery,
|
||||
packages: ${"$"}packages,
|
||||
objectTypes: $objectTypes,
|
||||
searchQuery: $searchQuery,
|
||||
packages: $packages,
|
||||
genres: [],
|
||||
excludeGenres: [],
|
||||
releaseYear: ${"$"}releaseYear
|
||||
releaseYear: $releaseYear
|
||||
}
|
||||
) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
objectType
|
||||
content(country: ${"$"}country, language: ${"$"}language) {
|
||||
content(country: $country, language: $language) {
|
||||
fullPath
|
||||
title
|
||||
shortDescription
|
||||
@@ -104,7 +104,7 @@ class Torrentio :
|
||||
}
|
||||
posterUrl
|
||||
genres {
|
||||
translation(language: ${"$"}language)
|
||||
translation(language: $language)
|
||||
}
|
||||
credits {
|
||||
name
|
||||
@@ -192,13 +192,25 @@ class Torrentio :
|
||||
override fun latestUpdatesParse(response: Response) = throw UnsupportedOperationException()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -243,9 +255,9 @@ class Torrentio :
|
||||
// override suspend fun getAnimeDetails(anime: SAnime): SAnime = throw UnsupportedOperationException()
|
||||
|
||||
override suspend fun getAnimeDetails(anime: SAnime): SAnime {
|
||||
val query = """
|
||||
query GetUrlTitleDetails(${"$"}fullPath: String!, ${"$"}country: Country!, ${"$"}language: Language!) {
|
||||
urlV2(fullPath: ${"$"}fullPath) {
|
||||
val query = $$"""
|
||||
query GetUrlTitleDetails($fullPath: String!, $country: Country!, $language: Language!) {
|
||||
urlV2(fullPath: $fullPath) {
|
||||
node {
|
||||
...TitleDetails
|
||||
}
|
||||
@@ -256,7 +268,7 @@ class Torrentio :
|
||||
... on MovieOrShowOrSeason {
|
||||
id
|
||||
objectType
|
||||
content(country: ${"$"}country, language: ${"$"}language) {
|
||||
content(country: $country, language: $language) {
|
||||
title
|
||||
shortDescription
|
||||
externalIds {
|
||||
@@ -264,7 +276,7 @@ class Torrentio :
|
||||
}
|
||||
posterUrl
|
||||
genres {
|
||||
translation(language: ${"$"}language)
|
||||
translation(language: $language)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,22 +17,17 @@ class TorrentioUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Torrentio.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Torrentio Anime (Torrent / Debrid)'
|
||||
extClass = '.Torrentio'
|
||||
extVersionCode = 17
|
||||
extVersionCode = 18
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ import kotlinx.serialization.json.buildJsonObject
|
||||
import kotlinx.serialization.json.put
|
||||
import kotlinx.serialization.json.putJsonArray
|
||||
import okhttp3.FormBody
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
@@ -171,13 +171,25 @@ class Torrentio :
|
||||
}
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,22 +17,17 @@ class TorrentioUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Torrentio.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -197,7 +197,7 @@ class ArabSeed :
|
||||
)
|
||||
|
||||
// =============================== Latest ===============================
|
||||
override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesFromElement(element: Element): SAnime = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesRequest(page: Int): Request = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesSelector(): String = throw UnsupportedOperationException()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Okanime'
|
||||
extClass = '.Okanime'
|
||||
extVersionCode = 24
|
||||
extVersionCode = 25
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -21,6 +21,7 @@ import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import keiyoushi.utils.useAsJsoup
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
@@ -64,13 +65,25 @@ class Okanime :
|
||||
override fun latestUpdatesNextPageSelector() = "ul.pagination > li:last-child:not(.disabled)"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,22 +17,17 @@ class OkanimeUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Okanime.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Einfach'
|
||||
extClass = '.Einfach'
|
||||
extVersionCode = 30
|
||||
extVersionCode = 31
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -25,6 +25,7 @@ import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -73,13 +74,27 @@ class Einfach :
|
||||
override fun latestUpdatesNextPageSelector() = popularAnimeNextPageSelector()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByPathParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val type = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
val item = url.pathSegments.getOrNull(2)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$type/$item", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByPathParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByPathParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,23 +17,17 @@ class EinfachUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 2) {
|
||||
val type = pathSegments[1]
|
||||
val item = pathSegments[2]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Einfach.PREFIX_SEARCH}$type/$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Cineby'
|
||||
extClass = '.Cineby'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,19 @@ class Cineby :
|
||||
query: String,
|
||||
filters: AnimeFilterList,
|
||||
): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val type = url.pathSegments.getOrNull(0)
|
||||
?: throw Exception("Unsupported url")
|
||||
val rawId = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
if (type !in listOf("movie", "tv")) throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_ID}$type/$rawId", filters)
|
||||
}
|
||||
|
||||
// Deep link from CinebyUrlActivity: "id:<type>/<id>"
|
||||
if (query.startsWith(PREFIX_ID)) {
|
||||
val rawPath = query.substringAfter(PREFIX_ID)
|
||||
|
||||
@@ -10,29 +10,17 @@ import kotlin.system.exitProcess
|
||||
class CinebyUrlActivity : Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size >= 2) {
|
||||
val type = pathSegments[0]
|
||||
val rawId = pathSegments[1]
|
||||
val isValidType = "movie" == type || "tv" == type
|
||||
|
||||
if (isValidType) {
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Cineby.PREFIX_ID}$type/$rawId")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e("CinebyUrlActivity", e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e("CinebyUrlActivity", "unknown type segment: $type")
|
||||
}
|
||||
} else {
|
||||
Log.e("CinebyUrlActivity", "could not parse uri from intent $intent")
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e("CinebyUrlActivity", "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Hstream'
|
||||
extClass = '.Hstream'
|
||||
extVersionCode = 10
|
||||
extVersionCode = 11
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,11 @@ import keiyoushi.utils.getPreferencesLazy
|
||||
import keiyoushi.utils.parseAs
|
||||
import keiyoushi.utils.toJsonRequestBody
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.net.URLDecoder
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
@@ -41,8 +39,6 @@ class Hstream :
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
|
||||
// URLs from the old extension are invalid now, so we're bumping this to
|
||||
// make aniyomi interpret it as a new source, forcing old users to migrate.
|
||||
override val versionId = 2
|
||||
@@ -75,13 +71,25 @@ class Hstream :
|
||||
// =============================== Search ===============================
|
||||
override fun getFilterList() = HstreamFilters.FILTER_LIST
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/hentai/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/hentai/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,22 +17,17 @@ class HstreamUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Hstream.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'KickAssAnime'
|
||||
extClass = '.KickAssAnime'
|
||||
extVersionCode = 59
|
||||
extVersionCode = 60
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -270,14 +270,24 @@ class KickAssAnime :
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val slug = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$SEARCH_BASE_URL/api/show/$slug"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeBySlugParse)
|
||||
} else {
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != PREF_DOMAIN_DEFAULT.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val slug = url.pathSegments.getOrNull(0)?.takeIf(String::isNotBlank)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$slug", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val slug = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$SEARCH_BASE_URL/api/show/$slug"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeBySlugParse)
|
||||
}
|
||||
val params = KickAssAnimeFilters.getSearchParameters(filters)
|
||||
client.newCall(searchAnimeRequest(page, query, params))
|
||||
return client.newCall(searchAnimeRequest(page, query, params))
|
||||
.awaitSuccess()
|
||||
.use { response ->
|
||||
searchAnimeParse(response, page)
|
||||
|
||||
@@ -17,22 +17,17 @@ class KickAssAnimeUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size >= 1) {
|
||||
val slug = pathSegments[0]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${KickAssAnime.PREFIX_SEARCH}$slug")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -2,7 +2,7 @@ ext {
|
||||
extName = 'Miruro.tv'
|
||||
extClass = '.Miruro'
|
||||
isNsfw = true
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -162,6 +162,19 @@ class Miruro :
|
||||
// ============================== Search ===============================
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
if (url.pathSegments.getOrNull(0) != "watch") {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val anilistId = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$anilistId", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val anilistId = query.removePrefix(PREFIX_SEARCH)
|
||||
val request = buildPipeRequest("info/$anilistId", "GET")
|
||||
|
||||
@@ -17,24 +17,17 @@ class MiruroUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size >= 2 && pathSegments[0] == "watch") {
|
||||
// URL format: https://miruro.tv/watch/{anilistId}/{slug}
|
||||
// pathSegments[0] = "watch", pathSegments[1] = anilistId
|
||||
val anilistId = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Miruro.PREFIX_SEARCH}$anilistId")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'My Running Man'
|
||||
extClass = '.MyRunningMan'
|
||||
extVersionCode = 11
|
||||
extVersionCode = 12
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -15,11 +15,10 @@ import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import keiyoushi.utils.parseAs
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
@@ -33,8 +32,6 @@ class MyRunningMan : ParsedAnimeHttpSource() {
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
|
||||
// ============================== Popular ===============================
|
||||
override fun popularAnimeRequest(page: Int) = GET("$baseUrl/episodes/mostwatched/$page")
|
||||
|
||||
@@ -61,13 +58,25 @@ class MyRunningMan : ParsedAnimeHttpSource() {
|
||||
override fun latestUpdatesNextPageSelector() = popularAnimeNextPageSelector()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/ep/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/ep/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -91,7 +100,7 @@ class MyRunningMan : ParsedAnimeHttpSource() {
|
||||
title = it.label
|
||||
thumbnail_url = buildString {
|
||||
append("$baseUrl/assets/epimg/${it.value.padStart(3, '0')}")
|
||||
if (it.value.toIntOrNull() ?: 1 > 396) append("_temp")
|
||||
if ((it.value.toIntOrNull() ?: 1) > 396) append("_temp")
|
||||
append(".jpg")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,22 +17,17 @@ class MyRunningManUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${MyRunningMan.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Rule34Video'
|
||||
extClass = '.Rule34Video'
|
||||
extVersionCode = 9
|
||||
extVersionCode = 10
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.preference.SwitchPreferenceCompat
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
@@ -14,6 +15,7 @@ import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -77,6 +79,19 @@ class Rule34Video :
|
||||
// =============================== Search ===============================
|
||||
private inline fun <reified R> AnimeFilterList.getUriPart() = (find { it is R } as? UriPartFilter)?.toUriPart() ?: ""
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val slug = url.pathSegments.getOrNull(2)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$slug", filters)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val orderFilter = filters.getUriPart<OrderFilter>()
|
||||
val categoryFilter = filters.getUriPart<CategoryBy>()
|
||||
@@ -246,7 +261,6 @@ class Rule34Video :
|
||||
title = "Uploader ID"
|
||||
summary = "Enter the ID of the uploader (e.g., 98965). Requires \"Filter by Uploader\" to be enabled."
|
||||
dialogTitle = "Enter Uploader ID"
|
||||
var dependency = PREF_UPLOADER_FILTER_ENABLED_KEY
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
newValue?.toString().isNullOrBlank().not()
|
||||
}
|
||||
|
||||
@@ -13,22 +13,17 @@ class Rule34VideoUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 0) {
|
||||
val slug = pathSegments[2]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Rule34Video.PREFIX_SEARCH}$slug")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'az-animex'
|
||||
extClass = '.Azanimex'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.animeextension.es.azanimex
|
||||
|
||||
import android.util.Log
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
@@ -9,6 +10,7 @@ import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -186,6 +188,22 @@ class Azanimex : ParsedAnimeHttpSource() {
|
||||
|
||||
override fun searchAnimeSelector(): String = popularAnimeSelector()
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$id", filters)
|
||||
} else if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return super.getSearchAnime(page, id, filters)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val url = if (page > 1) {
|
||||
"$baseUrl/page/$page/?s=$query"
|
||||
@@ -216,7 +234,7 @@ class Azanimex : ParsedAnimeHttpSource() {
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element): SAnime = throw UnsupportedOperationException()
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
companion object {
|
||||
const val PREFIX_SEARCH = "id:"
|
||||
|
||||
@@ -17,22 +17,17 @@ class AzanimexUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Azanimex.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -203,7 +203,7 @@ class EnNovelas :
|
||||
}
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/search/$id", headers))
|
||||
.awaitSuccess()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Hackstore'
|
||||
extClass = '.Hackstore'
|
||||
extVersionCode = 37
|
||||
extVersionCode = 38
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -14,6 +14,7 @@ import aniyomi.lib.voeextractor.VoeExtractor
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
@@ -25,6 +26,7 @@ import keiyoushi.utils.bodyString
|
||||
import keiyoushi.utils.catchingFlatMapBlocking
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
@@ -117,6 +119,22 @@ class Hackstore :
|
||||
|
||||
override fun searchAnimeSelector(): String = popularAnimeSelector()
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$id", filters)
|
||||
} else if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return super.getSearchAnime(page, id, filters)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val filterList = if (filters.isEmpty()) getFilterList() else filters
|
||||
val genreFilter = filterList.find { it is GenreFilter } as GenreFilter
|
||||
|
||||
@@ -17,22 +17,17 @@ class HackstoreUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${Hackstore.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'VerSeriesOnline'
|
||||
extClass = '.VerSeriesOnline'
|
||||
extVersionCode = 17
|
||||
extVersionCode = 18
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -25,6 +25,7 @@ import keiyoushi.utils.parallelCatchingFlatMapBlocking
|
||||
import keiyoushi.utils.useAsJsoup
|
||||
import okhttp3.Cookie
|
||||
import okhttp3.FormBody
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.json.JSONObject
|
||||
@@ -68,12 +69,22 @@ class VerSeriesOnline :
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String = throw UnsupportedOperationException()
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/recherche?q=$id", headers))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$id", filters)
|
||||
}
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/recherche?q=$id", headers))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
val url = buildSearchUrl(query, page, filters)
|
||||
val document = client.newCall(GET(url, headers)).awaitSuccess().useAsJsoup()
|
||||
val animeList = document.select(searchAnimeSelector()).map { element ->
|
||||
@@ -83,7 +94,7 @@ class VerSeriesOnline :
|
||||
document.select(it).isNotEmpty()
|
||||
}
|
||||
|
||||
AnimesPage(animeList, hasNextPage)
|
||||
return AnimesPage(animeList, hasNextPage)
|
||||
}
|
||||
|
||||
private fun buildSearchUrl(query: String, page: Int, filters: AnimeFilterList): String {
|
||||
|
||||
@@ -17,22 +17,17 @@ class VerSeriesOnlineUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${VerSeriesOnline.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Anime-Sama'
|
||||
extClass = '.AnimeSama'
|
||||
extVersionCode = 25
|
||||
extVersionCode = 26
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -116,6 +116,24 @@ class AnimeSama :
|
||||
// =============================== Search ===============================
|
||||
override fun getFilterList() = AnimeSamaFilters.FILTER_LIST
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "$PREFIX_SEARCH$id", filters)
|
||||
} else if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
val animeUrl = if (id.startsWith("/")) "$baseUrl$id" else "$baseUrl/$id"
|
||||
val seasons = fetchAnimeSeasons(animeUrl)
|
||||
return AnimesPage(seasons, false)
|
||||
}
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val url = "$baseUrl/catalogue/".toHttpUrl().newBuilder()
|
||||
val params = AnimeSamaFilters.getSearchFilters(filters)
|
||||
|
||||
@@ -17,22 +17,17 @@ class AnimeSamaUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AnimeSama.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'AniSama'
|
||||
extClass = '.AniSama'
|
||||
extVersionCode = 22
|
||||
extVersionCode = 23
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -85,11 +85,23 @@ class AniSama :
|
||||
// =============================== Search ===============================
|
||||
override fun getFilterList() = aniSamaFilters.getFilterList()
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/$id")).awaitSuccess().use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/$id")).awaitSuccess().use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,22 +17,17 @@ class AniSamaUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AniSama.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'FRAnime'
|
||||
extClass = '.FrAnime'
|
||||
extVersionCode = 25
|
||||
extVersionCode = 26
|
||||
isNsfw = true
|
||||
}
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -63,6 +63,16 @@ class FrAnime : AnimeHttpSource() {
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, id, filters)
|
||||
}
|
||||
|
||||
val pages = database.filter {
|
||||
it.title.contains(query, true) ||
|
||||
it.originalTitle.contains(query, true) ||
|
||||
|
||||
@@ -13,21 +13,19 @@ class FrAnimeUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size == 2) {
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", pathSegments[1])
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
exitProcess(0)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'NimeGami'
|
||||
extClass = '.NimeGami'
|
||||
extVersionCode = 6
|
||||
extVersionCode = 7
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -15,6 +15,7 @@ import keiyoushi.lib.jsunpacker.JsUnpacker
|
||||
import keiyoushi.utils.parallelFlatMapBlocking
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
@@ -62,13 +63,25 @@ class NimeGami : ParsedAnimeHttpSource() {
|
||||
override fun latestUpdatesNextPageSelector() = "ul.pagination > li > a:contains(Next)"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.firstOrNull()?.takeIf(String::isNotBlank)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -152,7 +165,7 @@ class NimeGami : ParsedAnimeHttpSource() {
|
||||
extractVideos(url, quality, episodeIndex)
|
||||
}.getOrElse { emptyList() }
|
||||
}.flatten()
|
||||
}.let { it }
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractVideos(url: String, quality: String, episodeIndex: Int): List<Video> = with(url) {
|
||||
|
||||
@@ -17,22 +17,17 @@ class NimeGamiUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size == 1) {
|
||||
val item = pathSegments.first()
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${NimeGami.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'AniPlay'
|
||||
extClass = '.AniPlay'
|
||||
extVersionCode = 20
|
||||
extVersionCode = 21
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -69,13 +69,25 @@ class AniPlay :
|
||||
// =============================== Search ===============================
|
||||
override fun getFilterList() = AniPlayFilters.FILTER_LIST
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/series/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/series/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -221,7 +233,7 @@ class AniPlay :
|
||||
|
||||
private const val API_URL = "https://api.aniplay.co/api/series"
|
||||
|
||||
private val WRONG_KEY_REGEX by lazy { Regex("([a-zA-Z_]+):\\s?([\"|0-9|f|t|n|\\[|\\{])") }
|
||||
private val WRONG_KEY_REGEX by lazy { Regex("""([a-zA-Z_]+):\s?(["0-9ftn\[{]+)""") }
|
||||
|
||||
private val DATE_FORMATTER by lazy {
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
|
||||
|
||||
@@ -17,22 +17,17 @@ class AniPlayUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AniPlay.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Anime Fire'
|
||||
extClass = '.AnimeFire'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -17,23 +17,17 @@ class AFUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val id = pathSegments[1]
|
||||
val searchQuery = AnimeFire.PREFIX_SEARCH + id
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", searchQuery)
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
@@ -72,13 +73,25 @@ class AnimeFire :
|
||||
override fun latestUpdatesNextPageSelector() = "ul.pagination img.seta-right"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/animes/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/animes/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'AnimeQ'
|
||||
extClass = '.AnimeQ'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,25 @@ class AnimeQ :
|
||||
override fun latestUpdatesNextPageSelector() = "div.ContainerEps a.next.page-numbers"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(0)?.takeIf(String::isNotBlank)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -145,8 +157,8 @@ class AnimeQ :
|
||||
val document = response.asJsoup()
|
||||
|
||||
return document.select("div.videoBox div.aba")
|
||||
.parallelCatchingFlatMapBlocking {
|
||||
val format = document.selectFirst("a[href=#" + it.attr("id") + "]")?.text()
|
||||
.parallelCatchingFlatMapBlocking { div ->
|
||||
val format = document.selectFirst("a[href=#" + div.attr("id") + "]")?.text()
|
||||
?: "default"
|
||||
|
||||
val quality = when (format) {
|
||||
@@ -155,21 +167,21 @@ class AnimeQ :
|
||||
"FHD" -> "1080p"
|
||||
else -> format
|
||||
}
|
||||
val iframeSrc = it.selectFirst("iframe")?.tryGetAttr("data-litespeed-src", "src")
|
||||
val iframeSrc = div.selectFirst("iframe")?.tryGetAttr("data-litespeed-src", "src")
|
||||
if (!iframeSrc.isNullOrBlank()) {
|
||||
return@parallelCatchingFlatMapBlocking getVideosFromURL(iframeSrc, quality)
|
||||
}
|
||||
it.select("script").mapNotNull {
|
||||
var javascript = it.attr("src")
|
||||
?.substringAfter(";base64,")
|
||||
?.substringBefore('"')
|
||||
?.let { String(Base64.decode(it, Base64.DEFAULT)) }
|
||||
div.select("script").mapNotNull { script ->
|
||||
var javascript = script.attr("src")
|
||||
.substringAfter(";base64,")
|
||||
.substringBefore('"')
|
||||
.let { String(Base64.decode(it, Base64.DEFAULT)) }
|
||||
|
||||
if (javascript.isNullOrBlank()) {
|
||||
javascript = it.data()
|
||||
if (javascript.isBlank()) {
|
||||
javascript = script.data()
|
||||
}
|
||||
|
||||
if (javascript.isNullOrBlank() || "file:" !in javascript) {
|
||||
if (javascript.isBlank() || "file:" !in javascript) {
|
||||
return@mapNotNull null
|
||||
}
|
||||
|
||||
@@ -247,8 +259,8 @@ class AnimeQ :
|
||||
}
|
||||
|
||||
private fun Element.tryGetAttr(vararg attributeKeys: String): String? {
|
||||
val attributeKey = attributeKeys.first { hasAttr(it) }
|
||||
return attributeKey?.let { attr(attributeKey) }
|
||||
val attributeKey = attributeKeys.firstOrNull { hasAttr(it) }
|
||||
return attributeKey?.let { attr(it) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -17,23 +17,17 @@ class AnimeQUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 0) {
|
||||
val searchQuery = pathSegments[0]
|
||||
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AnimeQ.PREFIX_SEARCH}$searchQuery")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Animes CX'
|
||||
extClass = '.AnimesCX'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonArrayBuilder
|
||||
import kotlinx.serialization.json.buildJsonObject
|
||||
import kotlinx.serialization.json.putJsonArray
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
@@ -62,7 +63,7 @@ class AnimesCX :
|
||||
thumbnail_url = element.selectFirst("img")?.absUrl("src")
|
||||
}
|
||||
|
||||
override fun popularAnimeNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun popularAnimeNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =============================== Latest ===============================
|
||||
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/doramas-em-lancamento/page/$page", headers)
|
||||
@@ -73,16 +74,28 @@ class AnimesCX :
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element): SAnime = throw UnsupportedOperationException()
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path", headers))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val path = url.pathSegments.takeIf { it.isNotEmpty() }?.joinToString("/")
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$path", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$path", headers))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
@@ -17,22 +17,17 @@ class AnimesCXUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val path = pathSegments.joinToString("/")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AnimesCX.PREFIX_SEARCH}$path")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Animes Digital'
|
||||
extClass = '.AnimesDigital'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -66,13 +66,25 @@ class AnimesDigital :
|
||||
// =============================== Search ===============================
|
||||
override fun getFilterList() = AnimesDigitalFilters.FILTER_LIST
|
||||
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/anime/a/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(2)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/anime/a/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -136,7 +148,7 @@ class AnimesDigital :
|
||||
val total_page: Int,
|
||||
)
|
||||
|
||||
override fun searchAnimeNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun searchAnimeNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =========================== Anime Details ============================
|
||||
override fun animeDetailsParse(document: Document) = SAnime.create().apply {
|
||||
|
||||
@@ -17,22 +17,17 @@ class AnimesDigitalUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 2) {
|
||||
val item = pathSegments[2]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AnimesDigital.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Animes Games'
|
||||
extClass = '.AnimesGames'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
}
|
||||
|
||||
apply plugin: "kei.plugins.extension.legacy"
|
||||
|
||||
@@ -13,7 +13,6 @@ import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.parseAs
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.FormBody
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
@@ -21,7 +20,6 @@ import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
@@ -39,8 +37,6 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||
.add("Referer", baseUrl)
|
||||
.add("Origin", baseUrl)
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
|
||||
// ============================== Popular ===============================
|
||||
override fun popularAnimeRequest(page: Int) = GET(baseUrl)
|
||||
|
||||
@@ -67,13 +63,25 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||
override fun latestUpdatesNextPageSelector() = "ol.pagination > a:contains(>)"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) { // URL intent handler
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/animes/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
override suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val id = url.pathSegments.getOrNull(1)
|
||||
?: throw Exception("Unsupported url")
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$id", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val id = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/animes/$id"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
@@ -143,7 +151,7 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||
thumbnail_url = element.selectFirst("img")!!.getImageUrl()
|
||||
}
|
||||
|
||||
override fun searchAnimeNextPageSelector(): String? = throw UnsupportedOperationException()
|
||||
override fun searchAnimeNextPageSelector() = throw UnsupportedOperationException()
|
||||
|
||||
// =========================== Anime Details ============================
|
||||
override fun animeDetailsParse(document: Document) = SAnime.create().apply {
|
||||
@@ -260,7 +268,7 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||
* Tries to get the image url via various possible attributes.
|
||||
* Taken from Tachiyomi's Madara multisrc.
|
||||
*/
|
||||
protected open fun Element.getImageUrl(): String? = when {
|
||||
private fun Element.getImageUrl(): String = when {
|
||||
hasAttr("data-src") -> attr("abs:data-src")
|
||||
hasAttr("data-lazy-src") -> attr("abs:data-lazy-src")
|
||||
hasAttr("srcset") -> attr("abs:srcset").substringBefore(" ")
|
||||
|
||||
@@ -17,22 +17,17 @@ class AnimesGamesUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 1) {
|
||||
val item = pathSegments[1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${AnimesGames.PREFIX_SEARCH}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", intent.data.toString())
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, "Unable to launch activity", e)
|
||||
}
|
||||
|
||||
finish()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'AnimesOnlineVip'
|
||||
extClass = '.AnimesOnlineVip'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@@ -65,13 +65,29 @@ class AnimesOnlineVip :
|
||||
page: Int,
|
||||
query: String,
|
||||
filters: AnimeFilterList,
|
||||
): AnimesPage = if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
): AnimesPage {
|
||||
if (query.startsWith("https://")) {
|
||||
val url = query.toHttpUrl()
|
||||
if (url.host != baseUrl.toHttpUrl().host) {
|
||||
throw Exception("Unsupported url")
|
||||
}
|
||||
val searchQuery = if (url.pathSegments.size > 1) {
|
||||
"${url.pathSegments[0]}/${url.pathSegments[1]}"
|
||||
} else {
|
||||
url.pathSegments.getOrNull(0)?.takeIf(String::isNotBlank)
|
||||
?: throw Exception("Unsupported url")
|
||||
}
|
||||
return getSearchAnime(page, "${PREFIX_SEARCH}$searchQuery", filters)
|
||||
}
|
||||
|
||||
if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
return client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
}
|
||||
|
||||
return super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user