-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fe9c12
commit 6ca19f9
Showing
3 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
40 changes: 37 additions & 3 deletions
40
sources/multisrc/madara/arnovel/src/ireader/arnovel/ArNovel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,52 @@ | ||
package ireader.arnovel | ||
|
||
|
||
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.madara.Path | ||
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 ArNovel(val deps: Dependencies) : Madara( | ||
deps, | ||
key = "https://arnovel.me", | ||
key = "https://ar-novel.com", | ||
sourceName = "arnovel", | ||
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)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters