Add Silent Manga Audition source (#3750)
* Add Silent Manga Audition source. * Change uppercase titles. * Put entry theme back in the title.
This commit is contained in:
parent
fdec2f1009
commit
6a44953465
|
@ -0,0 +1,12 @@
|
|||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
ext {
|
||||
extName = 'Silent Manga Audition'
|
||||
pkgNameSuffix = 'en.silentmangaaudition'
|
||||
extClass = '.SilentMangaAudition'
|
||||
extVersionCode = 1
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
|
@ -0,0 +1,119 @@
|
|||
package eu.kanade.tachiyomi.extension.en.silentmangaaudition
|
||||
|
||||
data class SmaEntry(
|
||||
val name: String,
|
||||
val url: String,
|
||||
val chapterListUrl: String,
|
||||
val thumbnailUrl: String
|
||||
)
|
||||
|
||||
val SMA_ENTRIES = listOf(
|
||||
SmaEntry(
|
||||
"SMA-13 “Together for peace”",
|
||||
"/sma13-silent-manga-audition-2020-award-winners/",
|
||||
"/v/sma13/homeless-by-simone-sanseverino/?lang=en",
|
||||
"https://www.manga-audition.com/wp/wp-content/themes/gridlove-child/assets/img/award-result/sma13/header_sp.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA-12 “New beginning”",
|
||||
"/sma12-silent-manga-audition-2019-award-winners/",
|
||||
"/v/sma12/never-late-by-lucas-marques-and-priscilla-miranda/?lang=en",
|
||||
"https://www.manga-audition.com/wp/wp-content/themes/gridlove-child/assets/img/award-result/sma12/header_sp.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA-EX5 “Kumamoto + Do Your Best!”",
|
||||
"/smaex5-silent-manga-audition-2019-award-winners/",
|
||||
"/v/smaex5/fish-by-youngman/",
|
||||
"https://www.manga-audition.com/wp/wp-content/themes/gridlove-child/assets/img/award-result/smaex5/top_banner_sp.jpg"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA11 “Promise”",
|
||||
"/sma11-silent-manga-audition-2019-award-winners/",
|
||||
"/v/sma11/reborn-by-riza-al-assami/?lang=en",
|
||||
"https://www.manga-audition.com/wp/wp-content/themes/gridlove-child/assets/img/award-result/sma11/top_banner_sp.jpg"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA-EX4 “Kit Kat ROUND”",
|
||||
"/smaex4-2018award/",
|
||||
"/v/smaex4/lucky-charm-by-harihtaroon/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/smaex4/smaex4_main01.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA10 “Effort / Friendship / Victory”",
|
||||
"/sma10-2018award-2/",
|
||||
"/v/sma10/run-by-riza-al-assami/?lang=en",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/sma10/sma10main_3.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA-EX3 “Kumamoto + Wasamon”",
|
||||
"/smaex3-2018award/",
|
||||
"/v/smaex3/to-the-sky-by-zevania-and-nattorin/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/smaex3/smaex3_main01.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA9 “Fairness / Respect / Teamwork”",
|
||||
"/sma9-2018award/",
|
||||
"/v/sma9/fisherman-tales-by-joao-eddie/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma9/sma9_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA8 “Fair Play”",
|
||||
"/sma8-2017award/",
|
||||
"/v/sma8/checkmate-by-sideburn004/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma8/sma8_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA7 “Unforgettable Taste”",
|
||||
"/sma7-2017award/",
|
||||
"/v/sma7/our-promised-land-by-nattorin-and-zevania/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma7/sma7_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA-EX2 “Kumamoto + Smile”",
|
||||
"http://data.smacmag.net/sma/smaex2-2017award/",
|
||||
"https://smacmag.net/v/sma2/drawing-a-smile-out-by-dee-juusan/",
|
||||
"http://data.smacmag.net/sma/smaex2-2017award/images/smaex2_title.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA6 “Childhood”",
|
||||
"/sma6-2016award/",
|
||||
"/v/sma6/forbidden-by-yos/13828",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma6/SMA06_themes.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA5 “Friend-ship + Communication Tool”",
|
||||
"/sma05-2016award/",
|
||||
"/v/sma5/im-happy-by-ds-studio/11915",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma5/sma5_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA-EX1 “Fukushima Sakuramori”",
|
||||
"/smaex1-2016award/",
|
||||
"/v/smaex1/seeds-by-jim/9574",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/smaex1/smaex1_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA4 “A Charming Gift”",
|
||||
"/sma04-2015award/",
|
||||
"/v/sma4/birdy-by-kalongzz/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma4/sma4_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA3 “Mother”",
|
||||
"/sma03-2015award/",
|
||||
"/v/sma3/homesick-alien-by-ichirou/4390",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma3/sma3_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA2 “The Finest Smile”",
|
||||
"/sma02-2014award/",
|
||||
"/v/sma2/fathers-gift-by-ichirou/1775",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma2/sma2_theme.png"
|
||||
),
|
||||
SmaEntry(
|
||||
"SMA1 “Love Letter”",
|
||||
"/sma01-2013award/",
|
||||
"/v/sma1/excuse-me-by-alex-irzaqi/",
|
||||
"https://s3-ap-northeast-1.amazonaws.com/data.smacmag.net/_images/sma_page/pc/sma1/sma1_theme.png"
|
||||
)
|
||||
)
|
|
@ -0,0 +1,134 @@
|
|||
package eu.kanade.tachiyomi.extension.en.silentmangaaudition
|
||||
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||
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.HttpSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.Headers
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Element
|
||||
import rx.Observable
|
||||
|
||||
class SilentMangaAudition : HttpSource() {
|
||||
|
||||
override val name = "Silent Manga Audition"
|
||||
|
||||
override val baseUrl = "https://manga-audition.com"
|
||||
|
||||
override val lang = "en"
|
||||
|
||||
override val supportsLatest = false
|
||||
|
||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||
.add("User-Agent", USER_AGENT)
|
||||
.add("Referer", baseUrl)
|
||||
|
||||
override fun fetchPopularManga(page: Int): Observable<MangasPage> {
|
||||
val entries = SMA_ENTRIES.mapIndexed { i, entry -> entry.toSManga(i) }
|
||||
return Observable.just(MangasPage(entries, false))
|
||||
}
|
||||
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||
val filteredEntries = SMA_ENTRIES
|
||||
.mapIndexed { i, entry -> entry.toSManga(i) }
|
||||
.filter {
|
||||
it.title.contains(query, true) ||
|
||||
it.description!!.contains(query, true)
|
||||
}
|
||||
|
||||
return Observable.just(MangasPage(filteredEntries, false))
|
||||
}
|
||||
|
||||
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
|
||||
val index = manga.url.substringAfterLast(",").toInt()
|
||||
val entry = SMA_ENTRIES[index]
|
||||
|
||||
// Fill all the data again because in backup only the title and the url are stored.
|
||||
return Observable.just(entry.toSManga(index))
|
||||
}
|
||||
|
||||
override fun mangaDetailsRequest(manga: SManga): Request {
|
||||
val url = manga.url.substringBefore(",")
|
||||
return GET(if (url.startsWith("/")) baseUrl + url else url, headers)
|
||||
}
|
||||
|
||||
override fun chapterListRequest(manga: SManga): Request {
|
||||
val url = manga.url
|
||||
.substringAfter(",")
|
||||
.substringBefore(",")
|
||||
|
||||
return GET(SMACMAG_URL + url, headers)
|
||||
}
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
return response.asJsoup()
|
||||
.select(chapterListSelector())
|
||||
.map { chapterFromElement(it) }
|
||||
}
|
||||
|
||||
private fun chapterListSelector(): String = "ol.playlist li a"
|
||||
|
||||
private fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
name = element.select("span.ttl")!!.text()
|
||||
scanlator = element.select("span.name")!!.text()
|
||||
url = element.attr("abs:href")
|
||||
}
|
||||
|
||||
override fun pageListRequest(chapter: SChapter): Request {
|
||||
return GET(chapter.url, headers)
|
||||
}
|
||||
|
||||
override fun pageListParse(response: Response): List<Page> {
|
||||
val chapterUrl = response.request().url().toString()
|
||||
|
||||
return response.asJsoup()
|
||||
.select("div.swiper-wrapper div.swiper-slide img.swiper-lazy")
|
||||
.mapIndexed { i, element -> Page(i, chapterUrl, element.attr("data-src")) }
|
||||
}
|
||||
|
||||
override fun fetchImageUrl(page: Page): Observable<String> = Observable.just(page.imageUrl!!)
|
||||
|
||||
override fun imageUrlParse(response: Response): String = ""
|
||||
|
||||
override fun imageRequest(page: Page): Request {
|
||||
val newHeaders = headersBuilder()
|
||||
.set("Referer", page.url)
|
||||
.build()
|
||||
|
||||
return GET(page.imageUrl!!, newHeaders)
|
||||
}
|
||||
|
||||
private fun SmaEntry.toSManga(index: Int): SManga = SManga.create().apply {
|
||||
title = name
|
||||
author = "Various artists"
|
||||
status = SManga.COMPLETED
|
||||
description = "The theme is… " + name.substringAfter(" ") + "."
|
||||
thumbnail_url = thumbnailUrl
|
||||
url = "${this@toSManga.url},$chapterListUrl,$index"
|
||||
}
|
||||
|
||||
override fun popularMangaRequest(page: Int): Request = throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun popularMangaParse(response: Response): MangasPage = throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun latestUpdatesRequest(page: Int): Request = throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun latestUpdatesParse(response: Response): MangasPage = throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun searchMangaParse(response: Response): MangasPage = throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun mangaDetailsParse(response: Response): SManga = throw UnsupportedOperationException("Not used")
|
||||
|
||||
companion object {
|
||||
private const val SMACMAG_URL = "https://smacmag.net"
|
||||
|
||||
private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue