Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kazemcodes committed Jun 12, 2024
2 parents 4dff5a4 + b44e0bc commit a0e6fcf
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 24 deletions.
2 changes: 1 addition & 1 deletion sources/ar/kolnovel/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
listOf("ar").map { lang ->
Extension(
name = "KolNovel",
versionCode = 4,
versionCode = 5,
libVersion = "1",
lang = lang,
description = "",
Expand Down
2 changes: 1 addition & 1 deletion sources/ar/kolnovel/main/src/ireader/kolnovel/KolNovel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class KolNovel(deps: Dependencies) : SourceFactory(
override val lang: String
get() = "ar"
override val baseUrl: String
get() = "https://kolnovel.com"
get() = "https://kolnovel.club"
override val id: Long
get() = 41
override val name: String
Expand Down
4 changes: 2 additions & 2 deletions sources/ar/novelparadise/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
listOf("en").map { lang ->
listOf("ar").map { lang ->
Extension(
name = "NovelParadise",
versionCode = 1,
versionCode = 2,
libVersion = "1",
lang = lang,
description = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class NovelParadise(private val deps: Dependencies) : SourceFactory(
override val lang: String
get() = "ar"
override val baseUrl: String
get() = "https://novelsparadise.net"
get() = "https://novelsparadise.site"
override val id: Long
get() = 50
override val name: String
Expand Down
2 changes: 1 addition & 1 deletion sources/ar/riwyat/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
listOf("ar").map { lang ->
Extension(
name = "Riwyat",
versionCode = 5,
versionCode = 6,
libVersion = "1",
lang = lang,
description = "",
Expand Down
2 changes: 1 addition & 1 deletion sources/ar/riwyat/main/src/ireader/riwyat/Riwyat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class Riwyat(private val deps: Dependencies) : SourceFactory(
override val lang: String
get() = "ar"
override val baseUrl: String
get() = "https://riwyat.com"
get() = "https://riwyat.org"
override val id: Long
get() = 23
override val name: String
Expand Down
2 changes: 1 addition & 1 deletion sources/en/freewebnovel/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
listOf("en").map { lang ->
Extension(
name = "FreeWebNovel",
versionCode = 8,
versionCode = 9,
libVersion = "1",
lang = lang,
description = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,33 @@ abstract class FreeWebNovel(deps: Dependencies) : ParsedHttpSource(deps) {
val sorts = filters.findInstance<Filter.Sort>()?.value?.index
val query = filters.findInstance<Filter.Title>()?.value
if (!query.isNullOrBlank()) {
return getSearch(page, query)
return getSearch(query)
}
return when (sorts) {
0 -> getLatest(page)
1 -> getPopular(page)
1 -> getPopular()
2 -> getNewNovel(page)
else -> getLatest(page)
}
}

suspend fun getLatest(page: Int): MangasPageInfo {
val res = requestBuilder("$baseUrl/latest-release-novel/$page/")
return bookListParse(client.get(res).asJsoup(), "div.ul-list1 div.li", "div.ul-list1") { latestFromElement(it) }
private suspend fun getLatest(page: Int): MangasPageInfo {
val req = requestBuilder("$baseUrl/latest-release-novels/$page/")
// resp can be 404
val resp = client.get(req)
return bookListParse(resp.asJsoup(), "div.ul-list1 div.li", "div.ul-list1") { latestFromElement(it) }
}
suspend fun getPopular(page: Int): MangasPageInfo {
val res = requestBuilder("$baseUrl/most-popular-novel/")
return bookListParse(client.get(res).asJsoup(), "div.ul-list1 div.li-row", null) { popularFromElement(it) }
private suspend fun getPopular(): MangasPageInfo {
val req = requestBuilder("$baseUrl/most-popular-novels/")
// resp can be 404
val resp = client.get(req)
return bookListParse(resp.asJsoup(), "div.ul-list1 div.li-row", null) { popularFromElement(it) }
}
suspend fun getSearch(page: Int, query: String): MangasPageInfo {
val res = requestBuilder("$baseUrl/search/?searchkey=$query")
return bookListParse(client.get(res).asJsoup(), "div.ul-list1 div.li-row", null) { searchFromElement(it) }
private suspend fun getSearch(query: String): MangasPageInfo {
val req = requestBuilder("$baseUrl/search/?searchkey=$query")
// resp can be 404
val resp = client.get(req)
return bookListParse(resp.asJsoup(), "div.ul-list1 div.li-row", null) { searchFromElement(it) }
}

private suspend fun getNewNovel(page: Int): MangasPageInfo {
Expand Down Expand Up @@ -183,10 +189,6 @@ abstract class FreeWebNovel(deps: Dependencies) : ParsedHttpSource(deps) {
return document.select("div.txt h4,p").eachText()
}

override suspend fun getContents(chapter: ChapterInfo): List<String> {
return pageContentParse(client.get(contentRequest(chapter)).asJsoup())
}

override fun contentRequest(chapter: ChapterInfo): HttpRequestBuilder {
return HttpRequestBuilder().apply {
url(chapter.key)
Expand Down
2 changes: 1 addition & 1 deletion sources/en/scribblehub/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
listOf("en").map { lang ->
Extension(
name = "ScribbleHub",
versionCode = 2,
versionCode = 3,
libVersion = "1",
lang = lang,
description = "",
Expand Down
13 changes: 13 additions & 0 deletions sources/en/scribblehub/main/src/ireader/scribblehub/Scribblehub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ abstract class Scribblehub(private val deps: Dependencies) : SourceFactory(

override fun getFilters(): FilterList = listOf(
Filter.Title(),
Filter.Sort("Sort By:", arrayOf("Popular", "Latest"))
)

override fun getCommands(): CommandList {
Expand All @@ -52,6 +53,18 @@ abstract class Scribblehub(private val deps: Dependencies) : SourceFactory(
nextPageSelector = "body",
linkAtt = "href",
),
BaseExploreFetcher(
"Latest",
endpoint = "/?pg={page}",
selector = "tr.toc_w",
nameSelector = "a.fp_title",
nameAtt = "title",
coverSelector = "img",
coverAtt = "src",
linkSelector = "a.fp_title",
linkAtt = "href",
nextPageSelector = "body"
),
BaseExploreFetcher(
"Search",
endpoint = "/?s={query}&post_type=fictionposts",
Expand Down
Binary file added sources/multisrc/madara/azora/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions sources/multisrc/madara/azora/src/ireader/azora/azora.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package ireader.azora


import io.ktor.client.request.post
import io.ktor.client.statement.bodyAsText
import ireader.core.log.Log
import ireader.madara.Madara
import ireader.core.source.Dependencies
import ireader.core.source.asJsoup
import ireader.core.source.findInstance
import ireader.core.source.model.ChapterInfo
import ireader.core.source.model.Command
import ireader.core.source.model.MangaInfo
import ireader.core.source.model.Page
import ireader.core.source.model.Text
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import tachiyomix.annotations.Extension

@Extension
abstract class Azora(val deps: Dependencies) : Madara(
deps,
key = "https://azorago.com",
sourceName = "azora",
sourceId = 65,
language = "ar",
){
override suspend fun getChapterList(
manga: MangaInfo,
commands: List<Command<*>>
): List<ChapterInfo> {
commands.findInstance<Command.Chapter.Fetch>()?.let {
return chaptersParse(Jsoup.parse(it.html)).reversed()
}
val html = client.post(
"${manga.key}ajax/chapters/"
).bodyAsText()
val chapters =
chaptersParse(
html.asJsoup(),
)
return chapters.reversed()
}

override fun chapterFromElement(element: Element): ChapterInfo {
val link = baseUrl + element.select("a").attr("href").substringAfter(baseUrl)
val name = element.select("a").text()
val dateUploaded = element.select("i").text()

return ChapterInfo(name = name, key = link, dateUpload = parseChapterDate(dateUploaded))
}
}
11 changes: 11 additions & 0 deletions sources/multisrc/madara/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,15 @@ listOf(
assetsDir = "multisrc/madara/mtlnovelclub/assets",
sourceDir = "mtlnovelclub",
),
Extension(
name = "Azora",
versionCode = 2,
libVersion = "1",
lang = "ar",
description = "",
nsfw = false,
icon = DEFAULT_ICON,
assetsDir = "multisrc/madara/azora/assets",
sourceDir = "azora",
),
).also(::register)

0 comments on commit a0e6fcf

Please sign in to comment.