Add RDScans (#10327)
This commit is contained in:
parent
efe09f539b
commit
a62e17736c
10
src/en/rdscans/build.gradle
Normal file
10
src/en/rdscans/build.gradle
Normal file
@ -0,0 +1,10 @@
|
||||
ext {
|
||||
extName = 'RD Scans'
|
||||
extClass = '.RDScans'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://rdscans.com'
|
||||
overrideVersionCode = 0
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
BIN
src/en/rdscans/res/mipmap-hdpi/ic_launcher.png
Normal file
BIN
src/en/rdscans/res/mipmap-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
BIN
src/en/rdscans/res/mipmap-mdpi/ic_launcher.png
Normal file
BIN
src/en/rdscans/res/mipmap-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
src/en/rdscans/res/mipmap-xhdpi/ic_launcher.png
Normal file
BIN
src/en/rdscans/res/mipmap-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
BIN
src/en/rdscans/res/mipmap-xxhdpi/ic_launcher.png
Normal file
BIN
src/en/rdscans/res/mipmap-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
src/en/rdscans/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
BIN
src/en/rdscans/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@ -0,0 +1,52 @@
|
||||
package eu.kanade.tachiyomi.extension.en.rdscans
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
|
||||
class RDScans : Madara(
|
||||
"RD Scans",
|
||||
"https://rdscans.com",
|
||||
"en",
|
||||
) {
|
||||
override val mangaSubString = "new"
|
||||
override val mangaEntrySelector = ""
|
||||
override val useNewChapterEndpoint = true
|
||||
|
||||
private fun parseBrowsePage(mangasPage: MangasPage): MangasPage {
|
||||
// Normally returns a 200 OK with a challenge page which leads to a "No results found" error for the user.
|
||||
// This check throws an exception instead, prompting the user to view in WebView first.
|
||||
if (mangasPage.mangas.isEmpty()) {
|
||||
throw Exception("Failed to bypass Cloudflare")
|
||||
}
|
||||
return filterWebNovels(mangasPage)
|
||||
}
|
||||
|
||||
private fun filterWebNovels(mangasPage: MangasPage): MangasPage {
|
||||
val filteredMangas = mangasPage.mangas.filterNot {
|
||||
it.title.contains("(WN)", ignoreCase = true)
|
||||
}
|
||||
return MangasPage(filteredMangas, mangasPage.hasNextPage)
|
||||
}
|
||||
|
||||
override fun popularMangaParse(response: Response): MangasPage {
|
||||
return parseBrowsePage(super.popularMangaParse(response))
|
||||
}
|
||||
|
||||
override fun latestUpdatesParse(response: Response): MangasPage {
|
||||
return parseBrowsePage(super.latestUpdatesParse(response))
|
||||
}
|
||||
|
||||
override fun searchMangaParse(response: Response): MangasPage {
|
||||
return filterWebNovels(super.searchMangaParse(response))
|
||||
}
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
launchIO { countViews(document) }
|
||||
return document.select("div.reading-content .separator img").mapIndexed { i, img ->
|
||||
Page(i, document.location(), imageFromElement(img))
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user