Addes new source Rain Of Snow (#5778)

* Create build.gradle

* added Rain of Snow extension
This commit is contained in:
Johannes Joens 2021-02-11 12:47:24 +00:00 committed by GitHub
parent b4afa0323e
commit f869fc931f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 128 additions and 0 deletions

View File

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

View File

@ -0,0 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'Rain Of Snow'
pkgNameSuffix = 'en.rainofsnow'
extClass = '.RainOfSnow'
extVersionCode = 1
libVersion = '1.2'
containsNsfw = false
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

View File

@ -0,0 +1,113 @@
package eu.kanade.tachiyomi.extension.en.rainofsnow
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.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.concurrent.TimeUnit
open class RainOfSnow() : ParsedHttpSource() {
override val name = "Rain Of Snow"
override val baseUrl = "https://rainofsnow.com"
override val lang = "en"
override val supportsLatest = false
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build()
override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/comic/")
}
override fun popularMangaSelector() = "ul.boxhover1 li"
override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.url = element.select("h4 a").attr("abs:href")
manga.title = element.select("h4").text()
manga.thumbnail_url = element.select("img").attr("abs:src")
return manga
}
override fun popularMangaNextPageSelector() = ".page-numbers .next"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = HttpUrl.parse("$baseUrl/")!!.newBuilder()
url.addQueryParameter("serchfor", "comics")
url.addQueryParameter("s", query)
return GET(url.build().toString(), headers)
}
override fun searchMangaSelector() = popularMangaSelector()
override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element)
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun mangaDetailsRequest(manga: SManga): Request {
if (manga.url.startsWith("http")) {
return GET(manga.url, headers)
}
return super.mangaDetailsRequest(manga)
}
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
manga.title = document.select("h3").text()
manga.author = document.select("li:contains(author) .n2").text()
manga.artist = document.select("li:contains(author) .n2").text()
manga.status = 0
manga.genre = document.select("li:contains(tags) .n2").text()
manga.description = document.select(".col-md-8 .text").text()
manga.thumbnail_url = document.select(".imgbox img").attr("abs:src")
return manga
}
override fun chapterListRequest(manga: SManga): Request {
if (manga.url.startsWith("http")) {
return GET(manga.url, headers)
}
return super.chapterListRequest(manga)
}
override fun chapterListSelector() = ".chapter1 li"
override fun chapterFromElement(element: Element): SChapter {
val chapter = SChapter.create()
chapter.url = element.select("a").attr("abs:href")
chapter.name = element.select("a").text()
return chapter
}
override fun pageListRequest(chapter: SChapter): Request {
if (chapter.url.startsWith("http")) {
return GET(chapter.url, headers)
}
return super.pageListRequest(chapter)
}
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
document.select(".zoomdesc-cont img").forEachIndexed { index, element ->
add(Page(index, "", element.attr("abs:src")))
}
}
override fun latestUpdatesFromElement(element: Element) = throw Exception("Not used")
override fun latestUpdatesNextPageSelector() = throw Exception("Not used")
override fun latestUpdatesRequest(page: Int) = throw Exception("Not used")
override fun latestUpdatesSelector() = throw Exception("Not used")
override fun imageUrlParse(document: Document) = throw Exception("Not used")
}