aniage: fix parsing m3u

Need full re-write this shitcode...
This commit is contained in:
CakesTwix 2023-11-17 23:32:27 +02:00
parent e7dff2532c
commit 66f975b479
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 8 version = 9
dependencies{ dependencies{
implementation("com.google.code.gson:gson:2.9.0") implementation("com.google.code.gson:gson:2.9.0")

View file

@ -233,7 +233,7 @@ class AniageProvider : MainAPI() {
val jsonObject = JSONObject(document.selectFirst("script[type*=application/json]")!!.html()) val jsonObject = JSONObject(document.selectFirst("script[type*=application/json]")!!.html())
val buildId = jsonObject.getString("buildId") val buildId = jsonObject.getString("buildId")
val animeJSON = Gson().fromJson(app.get("$mainUrl/_next/data/$buildId/watch/${dataList[0]}.json").text, AnimeDetail::class.java) val animeJSON = Gson().fromJson(app.get("$mainUrl/_next/data/$buildId/watch.json?wid=${dataList[0]}").text, AnimeDetail::class.java)
// Parse list, by episode // Parse list, by episode
animeJSON.pageProps.teams.map { teams -> animeJSON.pageProps.teams.map { teams ->
@ -245,7 +245,7 @@ class AniageProvider : MainAPI() {
if(dataList[1].toIntOrNull() == null){ if(dataList[1].toIntOrNull() == null){
M3u8Helper.generateM3u8( M3u8Helper.generateM3u8(
source = TeamsList.name, source = TeamsList.name,
streamUrl = dataList[1], streamUrl = dataList[1].replace("}", ""),
referer = mainUrl referer = mainUrl
).forEach(callback) ).forEach(callback)
return true return true