RocksManga: fix selectors and domain (#4476)

This commit is contained in:
AwkwardPeak7 2024-08-08 07:26:10 +05:00 committed by Draff
parent 93c5a106c4
commit 425d6e839d
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 43 additions and 17 deletions

View File

@ -2,8 +2,8 @@ ext {
extName = 'Rocks Manga' extName = 'Rocks Manga'
extClass = '.RocksManga' extClass = '.RocksManga'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://rocks-manga.com' baseUrl = 'https://rocksmanga.com'
overrideVersionCode = 0 overrideVersionCode = 1
isNsfw = false isNsfw = false
} }

View File

@ -2,39 +2,65 @@ package eu.kanade.tachiyomi.extension.ar.rocksmanga
import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
class RocksManga : Madara( class RocksManga : Madara(
"Rocks Manga", "Rocks Manga",
"https://rocks-manga.com", "https://rocksmanga.com",
"ar", "ar",
dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("ar")), dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("ar")),
) { ) {
override fun popularMangaSelector() = ".shido-manga" override fun popularMangaSelector() = "div.page-content-listing > .manga"
override val popularMangaUrlSelector = "a.s-manga-title" override val popularMangaUrlSelector = "div.manga-poster a"
override val mangaDetailsSelectorTitle = ".title"
override val mangaDetailsSelectorAuthor = ".heading:contains(المؤلف:) + .content a" override fun popularMangaFromElement(element: Element): SManga {
override val mangaDetailsSelectorArtist = ".heading:contains(الرسام:) + .content a" return super.popularMangaFromElement(element).apply {
title = element.selectFirst(popularMangaUrlSelector)!!.attr("title")
}
}
override fun searchMangaSelector() = "#manga-search-results .manga-item"
override fun searchMangaFromElement(element: Element): SManga {
val manga = SManga.create()
with(element) {
selectFirst("a.cover")!!.let {
manga.setUrlWithoutDomain(it.attr("abs:href"))
manga.title = it.attr("title")
}
selectFirst("img")?.let {
manga.thumbnail_url = imageFromElement(it)
}
}
return manga
}
override val mangaDetailsSelectorTitle = ".manga-title"
override val mangaDetailsSelectorAuthor = "div.meta span:contains(المؤلف:) + span a"
override val mangaDetailsSelectorArtist = "div.meta span:contains(الرسام:) + span a"
override val mangaDetailsSelectorStatus = ".status" override val mangaDetailsSelectorStatus = ".status"
override val mangaDetailsSelectorDescription = ".story" override val mangaDetailsSelectorDescription = "div.description"
override val mangaDetailsSelectorThumbnail = ".profile-manga .poster img" override val mangaDetailsSelectorThumbnail = ".manga-poster img"
override val mangaDetailsSelectorGenre = ".heading:contains(التصنيف:) + .content a" override val mangaDetailsSelectorGenre = "div.meta span:contains(التصنيف:) + span a"
override val altNameSelector = ".other-name" override val altNameSelector = "div.alternative"
override fun chapterListSelector() = "#chapter-list li.chapter-item" override fun chapterListSelector() = ".chapters-list li.chapter-item"
override fun chapterDateSelector() = ".ch-post-time" override fun chapterDateSelector() = ".chapter-release-date"
override val pageListParseSelector = ".reading-content img" override val pageListParseSelector = ".chapter-reading-page img"
override val useLoadMoreRequest = LoadMoreStrategy.Never override val useLoadMoreRequest = LoadMoreStrategy.Never
override val useNewChapterEndpoint = false override val useNewChapterEndpoint = false
override val fetchGenres = false
override val filterNonMangaItems = false override val filterNonMangaItems = false
override fun chapterFromElement(element: Element): SChapter { override fun chapterFromElement(element: Element): SChapter {
val chapter = super.chapterFromElement(element) val chapter = super.chapterFromElement(element)
chapter.name = element.selectFirst(".detail-ch")!!.text() chapter.name = element.selectFirst(".num")!!.text()
return chapter return chapter
} }
} }