From f248c8b1a8786151f8e33e6e7dbb6280c30a076f Mon Sep 17 00:00:00 2001 From: Secozzi <49240133+Secozzi@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:45:38 +0000 Subject: [PATCH] fix(ko/aniweek): Fix video extraction (#2455) --- src/ko/aniweek/build.gradle | 14 +- .../animeextension/ko/aniweek/Aniweek.kt | 131 +++++++++--------- 2 files changed, 78 insertions(+), 67 deletions(-) diff --git a/src/ko/aniweek/build.gradle b/src/ko/aniweek/build.gradle index 14125914b8..89c0925d8f 100644 --- a/src/ko/aniweek/build.gradle +++ b/src/ko/aniweek/build.gradle @@ -1,13 +1,19 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlinx-serialization' +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.serialization) +} ext { extName = 'Aniweek' pkgNameSuffix = 'ko.aniweek' extClass = '.Aniweek' - extVersionCode = 2 + extVersionCode = 3 libVersion = '13' } +dependencies { + implementation(project(':lib-playlist-utils')) +} + apply from: "$rootDir/common.gradle" diff --git a/src/ko/aniweek/src/eu/kanade/tachiyomi/animeextension/ko/aniweek/Aniweek.kt b/src/ko/aniweek/src/eu/kanade/tachiyomi/animeextension/ko/aniweek/Aniweek.kt index d240d17d1a..bcb4014827 100644 --- a/src/ko/aniweek/src/eu/kanade/tachiyomi/animeextension/ko/aniweek/Aniweek.kt +++ b/src/ko/aniweek/src/eu/kanade/tachiyomi/animeextension/ko/aniweek/Aniweek.kt @@ -12,12 +12,14 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.model.Track import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource +import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.Serializable -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json +import okhttp3.FormBody +import okhttp3.Headers import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient @@ -205,20 +207,33 @@ class Aniweek : ConfigurableAnimeSource, ParsedAnimeHttpSource() { // ============================ Video Links ============================= + private val playlistUtils by lazy { PlaylistUtils(client, headers) } + override fun videoListParse(response: Response): List