From 7afaedb637dd2f541ec146b8f6f1528c2448ea6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Krasie=C5=84ko?= <73482111+Hayanek@users.noreply.github.com> Date: Fri, 24 May 2024 11:19:40 +0200 Subject: [PATCH] feat(src/pl): New source: OgladajAnime (#3260) Co-authored-by: Hayanek --- lib/cda-extractor/build.gradle.kts | 3 + .../lib/cdaextractor/CdaExtractor.kt | 126 ++++++++ src/pl/ogladajanime/build.gradle | 17 ++ .../res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 2995 bytes .../res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 1677 bytes .../res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4049 bytes .../res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7226 bytes .../res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10797 bytes .../pl/ogladajanime/OgladajAnime.kt | 287 ++++++++++++++++++ 9 files changed, 433 insertions(+) create mode 100644 lib/cda-extractor/build.gradle.kts create mode 100644 lib/cda-extractor/src/main/java/eu/kanade/tachiyomi/lib/cdaextractor/CdaExtractor.kt create mode 100644 src/pl/ogladajanime/build.gradle create mode 100644 src/pl/ogladajanime/res/mipmap-hdpi/ic_launcher.png create mode 100644 src/pl/ogladajanime/res/mipmap-mdpi/ic_launcher.png create mode 100644 src/pl/ogladajanime/res/mipmap-xhdpi/ic_launcher.png create mode 100644 src/pl/ogladajanime/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 src/pl/ogladajanime/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 src/pl/ogladajanime/src/eu/kanade/tachiyomi/animeextension/pl/ogladajanime/OgladajAnime.kt diff --git a/lib/cda-extractor/build.gradle.kts b/lib/cda-extractor/build.gradle.kts new file mode 100644 index 0000000000..c26cbc8a82 --- /dev/null +++ b/lib/cda-extractor/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("lib-android") +} diff --git a/lib/cda-extractor/src/main/java/eu/kanade/tachiyomi/lib/cdaextractor/CdaExtractor.kt b/lib/cda-extractor/src/main/java/eu/kanade/tachiyomi/lib/cdaextractor/CdaExtractor.kt new file mode 100644 index 0000000000..4ce3fb0a04 --- /dev/null +++ b/lib/cda-extractor/src/main/java/eu/kanade/tachiyomi/lib/cdaextractor/CdaExtractor.kt @@ -0,0 +1,126 @@ +package eu.kanade.tachiyomi.lib.cdaextractor + +import eu.kanade.tachiyomi.animesource.model.Video +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.json.Json +import okhttp3.Headers +import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.OkHttpClient +import okhttp3.RequestBody.Companion.toRequestBody +import uy.kohesive.injekt.injectLazy +import java.net.URLDecoder +import java.nio.charset.StandardCharsets + +class CdaPlExtractor(private val client: OkHttpClient) { + + private val json: Json by injectLazy() + + fun getVideosFromUrl(url: String, headers: Headers, prefix: String): List