Rename "Fansubs.cat - Hentai" as "Hentai.cat" (#3430)

Rename "Fansubs.cat - Hentai" as "Hentai.cat", update logos and use the new API endpoint
This commit is contained in:
Fansubs.cat 2024-06-06 08:40:59 +02:00 committed by GitHub
parent 087cbfbb1c
commit 91968e2b06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 31 additions and 26 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc") id("lib-multisrc")
} }
baseVersionCode = 4 baseVersionCode = 5

View File

@ -30,11 +30,10 @@ abstract class FansubsCat(
override val name: String, override val name: String,
override val baseUrl: String, override val baseUrl: String,
override val lang: String, override val lang: String,
val apiBaseUrl: String,
val isHentaiSite: Boolean, val isHentaiSite: Boolean,
) : HttpSource() { ) : HttpSource() {
private val apiBaseUrl = "https://api.fansubs.cat"
override val supportsLatest = true override val supportsLatest = true
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()
@ -91,7 +90,7 @@ abstract class FansubsCat(
// Popular // Popular
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
return GET("$apiBaseUrl/manga/popular/$page?hentai=$isHentaiSite", headers) return GET("$apiBaseUrl/manga/popular/$page", headers)
} }
override fun popularMangaParse(response: Response): MangasPage = parseMangaFromJson(response) override fun popularMangaParse(response: Response): MangasPage = parseMangaFromJson(response)
@ -99,7 +98,7 @@ abstract class FansubsCat(
// Latest // Latest
override fun latestUpdatesRequest(page: Int): Request { override fun latestUpdatesRequest(page: Int): Request {
return GET("$apiBaseUrl/manga/recent/$page?hentai=$isHentaiSite", headers) return GET("$apiBaseUrl/manga/recent/$page", headers)
} }
override fun latestUpdatesParse(response: Response): MangasPage = parseMangaFromJson(response) override fun latestUpdatesParse(response: Response): MangasPage = parseMangaFromJson(response)
@ -110,13 +109,15 @@ abstract class FansubsCat(
val filterList = if (filters.isEmpty()) getFilterList() else filters val filterList = if (filters.isEmpty()) getFilterList() else filters
val mangaTypeFilter = filterList.find { it is MangaTypeFilter } as MangaTypeFilter val mangaTypeFilter = filterList.find { it is MangaTypeFilter } as MangaTypeFilter
val stateFilter = filterList.find { it is StateFilter } as StateFilter val stateFilter = filterList.find { it is StateFilter } as StateFilter
val demographyFilter = filterList.find { it is DemographyFilter } as DemographyFilter
val genreFilter = filterList.find { it is GenreTagFilter } as GenreTagFilter val genreFilter = filterList.find { it is GenreTagFilter } as GenreTagFilter
val themeFilter = filterList.find { it is ThemeTagFilter } as ThemeTagFilter val themeFilter = filterList.find { it is ThemeTagFilter } as ThemeTagFilter
val builder = "$apiBaseUrl/manga/search/$page?hentai=$isHentaiSite".toHttpUrl().newBuilder() val builder = "$apiBaseUrl/manga/search/$page".toHttpUrl().newBuilder()
mangaTypeFilter.addQueryParameter(builder) mangaTypeFilter.addQueryParameter(builder)
stateFilter.addQueryParameter(builder) stateFilter.addQueryParameter(builder)
demographyFilter.addQueryParameter(builder) if (!isHentaiSite) {
val demographyFilter = filterList.find { it is DemographyFilter } as DemographyFilter
demographyFilter.addQueryParameter(builder)
}
genreFilter.addQueryParameter(builder) genreFilter.addQueryParameter(builder)
themeFilter.addQueryParameter(builder) themeFilter.addQueryParameter(builder)
if (query.isNotBlank()) { if (query.isNotBlank()) {
@ -131,7 +132,7 @@ abstract class FansubsCat(
override fun mangaDetailsRequest(manga: SManga): Request { override fun mangaDetailsRequest(manga: SManga): Request {
return GET( return GET(
"$apiBaseUrl/manga/details/${manga.url.substringAfterLast('/')}?hentai=$isHentaiSite", "$apiBaseUrl/manga/details/${manga.url.substringAfterLast('/')}",
headers, headers,
) )
} }
@ -166,7 +167,7 @@ abstract class FansubsCat(
override fun chapterListRequest(manga: SManga): Request { override fun chapterListRequest(manga: SManga): Request {
return GET( return GET(
"$apiBaseUrl/manga/chapters/${manga.url.substringAfterLast('/')}?hentai=$isHentaiSite", "$apiBaseUrl/manga/chapters/${manga.url.substringAfterLast('/')}",
headers, headers,
) )
} }
@ -178,7 +179,7 @@ abstract class FansubsCat(
override fun pageListRequest(chapter: SChapter): Request { override fun pageListRequest(chapter: SChapter): Request {
return GET( return GET(
"$apiBaseUrl/manga/pages/${chapter.url.substringAfterLast('/')}?hentai=$isHentaiSite", "$apiBaseUrl/manga/pages/${chapter.url.substringAfterLast('/')}",
headers, headers,
) )
} }

View File

@ -1,6 +1,6 @@
ext { ext {
extName = 'Fansubs.cat' extName = 'Fansubs.cat'
extClass = '.FansubsCatMain' extClass = '.FansubsCat'
themePkg = 'fansubscat' themePkg = 'fansubscat'
baseUrl = 'https://manga.fansubs.cat' baseUrl = 'https://manga.fansubs.cat'
overrideVersionCode = 0 overrideVersionCode = 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -2,9 +2,10 @@ package eu.kanade.tachiyomi.extension.ca.fansubscat
import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat
class FansubsCatMain : FansubsCat( class FansubsCat : FansubsCat(
"Fansubs.cat", "Fansubs.cat",
"https://manga.fansubs.cat", "https://manga.fansubs.cat",
"ca", "ca",
"https://api.fansubs.cat",
isHentaiSite = false, isHentaiSite = false,
) )

View File

@ -1,8 +1,8 @@
ext { ext {
extName = 'Fansubs.cat - Hentai' extName = 'Hentai.cat'
extClass = '.FansubsCatHentai' extClass = '.HentaiCat'
themePkg = 'fansubscat' themePkg = 'fansubscat'
baseUrl = 'https://hentai.fansubs.cat/manga' baseUrl = 'https://manga.hentai.cat'
overrideVersionCode = 0 overrideVersionCode = 0
isNsfw = true isNsfw = true
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,10 +0,0 @@
package eu.kanade.tachiyomi.extension.ca.fansubscathentai
import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat
class FansubsCatHentai : FansubsCat(
"Fansubs.cat - Hentai",
"https://hentai.fansubs.cat/manga",
"ca",
isHentaiSite = true,
)

View File

@ -0,0 +1,13 @@
package eu.kanade.tachiyomi.extension.ca.fansubscathentai
import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat
class HentaiCat : FansubsCat(
"Hentai.cat",
"https://manga.hentai.cat",
"ca",
"https://api.hentai.cat",
isHentaiSite = true,
) {
override val id: Long = 7575385310756416449
}