From 9527daeb42ab83b636e97b6093500210badb0230 Mon Sep 17 00:00:00 2001 From: jmir1 Date: Sun, 28 Jan 2024 16:10:26 +0100 Subject: [PATCH] fix: Use Aniyomi's tracker API clients --- app/src/main/AndroidManifest.xml | 15 +++------------ .../tachiyomi/data/track/anilist/AnilistApi.kt | 2 +- .../tachiyomi/data/track/bangumi/BangumiApi.kt | 6 +++--- .../data/track/myanimelist/MyAnimeListApi.kt | 1 - .../track/myanimelist/MyAnimeListInterceptor.kt | 2 +- .../data/track/shikimori/ShikimoriApi.kt | 6 +++--- 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1abb199f1..ce23bfd78 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -237,21 +237,12 @@ - - - - - - - - - - - - + + + diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index 4c81ac189..8badca3c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt @@ -614,7 +614,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { } companion object { - private const val clientId = "385" + private const val clientId = "5338" private const val apiUrl = "https://graphql.anilist.co/" private const val baseUrl = "https://anilist.co/api/v2/" private const val baseMangaUrl = "https://anilist.co/manga/" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt index ec7331984..9acb42c38 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt @@ -315,14 +315,14 @@ class BangumiApi( ) companion object { - private const val clientId = "bgm10555cda0762e80ca" - private const val clientSecret = "8fff394a8627b4c388cbf349ec865775" + private const val clientId = "bgm293165b66d7e58156" + private const val clientSecret = "21d5f5c19ac24b4bc9c855ffa2387030" private const val apiUrl = "https://api.bgm.tv" private const val oauthUrl = "https://bgm.tv/oauth/access_token" private const val loginUrl = "https://bgm.tv/oauth/authorize" - private const val redirectUrl = "tachiyomi://bangumi-auth" + private const val redirectUrl = "aniyomi://bangumi-auth" fun authUrl(): Uri = loginUrl.toUri().buildUpon() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index 1f8252813..f28d44a74 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -25,7 +25,6 @@ import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive import kotlinx.serialization.json.long -import logcat.logcat import okhttp3.FormBody import okhttp3.Headers import okhttp3.OkHttpClient diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt index 0fbedc688..3faaf207b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt @@ -83,4 +83,4 @@ class MyAnimeListInterceptor(private val myanimelist: MyAnimeList) : Interceptor } } -class MALTokenExpired: IOException("MAL: Login has expired") +class MALTokenExpired : IOException("MAL: Login has expired") diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt index 8c9d3bbb6..139bd5a87 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt @@ -321,15 +321,15 @@ class ShikimoriApi( ) companion object { - private const val clientId = "1aaf4cf232372708e98b5abc813d795b539c5a916dbbfe9ac61bf02a360832cc" - private const val clientSecret = "229942c742dd4cde803125d17d64501d91c0b12e14cb1e5120184d77d67024c0" + private const val clientId = "aOAYRqOLwxpA8skpcQIXetNy4cw2rn2fRzScawlcQ5U" + private const val clientSecret = "jqjmORn6bh2046ulkm4lHEwJ3OA1RmO3FD2sR9f6Clw" private const val baseUrl = "https://shikimori.one" private const val apiUrl = "$baseUrl/api" private const val oauthUrl = "$baseUrl/oauth/token" private const val loginUrl = "$baseUrl/oauth/authorize" - private const val redirectUrl = "tachiyomi://shikimori-auth" + private const val redirectUrl = "aniyomi://shikimori-auth" fun authUrl(): Uri = loginUrl.toUri().buildUpon() .appendQueryParameter("client_id", clientId)