Asgard Team source fix (#8407)

* remove AsgardTeam

remove Asgard Team as it's not using madara theme anymore

* add Asgard Team source

fix asgard team manga as it's not using madara theme anymore

* update asgardteam version

update version
This commit is contained in:
Ahmed gamal 2021-08-05 16:40:39 +02:00 committed by GitHub
parent 8d8840c648
commit 792734c22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 147 additions and 1 deletions

View File

@ -38,7 +38,6 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("ArazNovel", "https://www.araznovel.com", "tr", overrideVersionCode = 1),
SingleLang("Argos Scan", "https://argosscan.com", "pt-BR", overrideVersionCode = 3),
SingleLang("Arthur Scan", "https://arthurscan.xyz", "pt-BR", overrideVersionCode = 2),
SingleLang("Asgard Team", "https://www.asgard1team.com", "ar", overrideVersionCode = 1),
SingleLang("Astral Library", "https://www.astrallibrary.net", "en", overrideVersionCode = 2),
SingleLang("Atikrost", "https://atikrost.com", "tr", overrideVersionCode = 1),
SingleLang("AZManhwa", "https://azmanhwa.net", "en"),

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="eu.kanade.tachiyomi.extension" />

View File

@ -0,0 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'Asgard Team'
pkgNameSuffix = 'ar.asgardteam'
extClass = '.AsgardTeam'
extVersionCode = 10
libVersion = '1.2'
}
apply from: "$rootDir/common.gradle"

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -0,0 +1,133 @@
package eu.kanade.tachiyomi.extension.ar.asgardteam
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.concurrent.TimeUnit
class AsgardTeam : ParsedHttpSource() {
override val name = "AsgardTeam"
override val baseUrl = "https://asgard1team.com"
override val lang = "ar"
override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build()
override fun headersBuilder(): Headers.Builder = super.headersBuilder()
.add("Referer", baseUrl)
// Popular
override fun popularMangaSelector() = "div.manga-card"
override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/manga-list/?page=$page", headers)
}
override fun popularMangaFromElement(element: Element): SManga = SManga.create().apply {
element.select("div.manga-details__container").let {
thumbnail_url = element.select("img").attr("abs:src")
// title = it.text()
}
element.select("div.manga-details__container").let {
title = element.select("img").attr("alt")
}
element.select("div a.manga-card__title").let {
setUrlWithoutDomain(it.attr("abs:href"))
// title = it.text()
}
}
override fun popularMangaNextPageSelector() = "ul.pagination a.page-link"
// Latest
override fun latestUpdatesRequest(page: Int): Request {
return GET(baseUrl)
}
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesFromElement(element: Element): SManga = popularMangaFromElement(element)
override fun latestUpdatesNextPageSelector(): String? = null
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
return GET("$baseUrl/search/?s=$query&page=$page", headers)
}
override fun searchMangaSelector() = popularMangaSelector()
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
// Details
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
return SManga.create().apply {
document.select("div.author-info-title").first().let { info ->
title = info.select("h6").text()
}
document.select("div.review-author-info").let { info ->
genre = info.select("a").joinToString { it.text() }
}
document.select("div.full-list-info:contains(المؤلف)").let { info ->
author = info.select("small").joinToString { it.text() }
}
document.select("div.full-list-info:contains(الرسام)").let { info ->
artist = info.select("small").joinToString { it.text() }
}
document.select("div.review-content").let { info ->
description = info.select("p").text()
}
}
}
// Chapters
override fun chapterListSelector() = "tbody > tr > td"
override fun chapterFromElement(element: Element): SChapter {
val chapter = SChapter.create()
element.select("a").let {
chapter.setUrlWithoutDomain(it.attr("abs:href"))
chapter.name = it.text()
}
chapter.date_upload = 0
return chapter
}
// Pages
override fun pageListParse(document: Document): List<Page> {
return document.select("section div.container div.container img").mapIndexed { i, img ->
Page(i, "", img.attr("abs:src"))
}
}
override fun imageRequest(page: Page): Request {
return GET(page.imageUrl!!, headersBuilder().set("Referer", page.url).build())
}
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}