MangaPlus: use alternative api endpoint that contains all latest updates (#11122)

use non-banner api endpoint that hopefully contains all updates
This commit is contained in:
nicki 2025-10-19 02:15:45 -07:00 committed by Draff
parent 007d231fa7
commit 9c74df6069
Signed by: Draff
GPG Key ID: E8A89F3211677653
3 changed files with 16 additions and 21 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'MANGA Plus by SHUEISHA' extName = 'MANGA Plus by SHUEISHA'
extClass = '.MangaPlusFactory' extClass = '.MangaPlusFactory'
extVersionCode = 55 extVersionCode = 56
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -128,8 +128,7 @@ class MangaPlus(
} }
} }
override fun latestUpdatesRequest(page: Int) = override fun latestUpdatesRequest(page: Int) = GET("$API_URL/home_v4?lang=$internalLang&clang=$internalLang&format=json", headers)
GET("$API_URL/web/web_homeV4?lang=$internalLang&clang=$internalLang&format=json", headers)
override fun latestUpdatesParse(response: Response): MangasPage { override fun latestUpdatesParse(response: Response): MangasPage {
val result = response.asMangaPlusResponse() val result = response.asMangaPlusResponse()
@ -138,7 +137,9 @@ class MangaPlus(
result.error!!.langPopup(langCode)?.body ?: intl["unknown_error"] result.error!!.langPopup(langCode)?.body ?: intl["unknown_error"]
} }
directory = result.success.webHomeViewV4!!.groups directory =
result.success.homeViewV3!!
.groups
.flatMap(UpdatedTitleV2Group::titleGroups) .flatMap(UpdatedTitleV2Group::titleGroups)
.flatMap(OriginalTitleGroup::titles) .flatMap(OriginalTitleGroup::titles)
.map(UpdatedTitle::title) .map(UpdatedTitle::title)
@ -146,18 +147,6 @@ class MangaPlus(
.distinctBy(Title::titleId) .distinctBy(Title::titleId)
titleCache.putAll(directory.associateBy(Title::titleId)) titleCache.putAll(directory.associateBy(Title::titleId))
titleCache.putAll(
result.success.webHomeViewV4.rankedTitles
.flatMap(RankedTitle::titles)
.filter { it.language == langCode }
.associateBy(Title::titleId),
)
titleCache.putAll(
result.success.webHomeViewV4.featuredTitleLists
.flatMap(FeaturedTitleList::featuredTitles)
.filter { it.language == langCode }
.associateBy(Title::titleId),
)
return parseDirectory(1) return parseDirectory(1)
} }

View File

@ -34,6 +34,7 @@ class SuccessResult(
val mangaViewer: MangaViewer? = null, val mangaViewer: MangaViewer? = null,
val allTitlesViewV2: AllTitlesViewV2? = null, val allTitlesViewV2: AllTitlesViewV2? = null,
val webHomeViewV4: WebHomeViewV4? = null, val webHomeViewV4: WebHomeViewV4? = null,
val homeViewV3: HomeViewV3? = null,
) )
@Serializable @Serializable
@ -62,6 +63,11 @@ class WebHomeViewV4(
val featuredTitleLists: List<FeaturedTitleList> = emptyList(), val featuredTitleLists: List<FeaturedTitleList> = emptyList(),
) )
@Serializable
class HomeViewV3(
val groups: List<UpdatedTitleV2Group> = emptyList(),
)
@Serializable @Serializable
class FeaturedTitleList( class FeaturedTitleList(
val featuredTitles: List<Title> = emptyList(), val featuredTitles: List<Title> = emptyList(),