diff --git a/src/de/cinemathek/AndroidManifest.xml b/src/de/cinemathek/AndroidManifest.xml new file mode 100644 index 000000000..acb4de356 --- /dev/null +++ b/src/de/cinemathek/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/de/cinemathek/build.gradle b/src/de/cinemathek/build.gradle new file mode 100644 index 000000000..82be4857a --- /dev/null +++ b/src/de/cinemathek/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + extName = 'Cinemathek' + pkgNameSuffix = 'de.cinemathek' + extClass = '.Cinemathek' + extVersionCode = 1 + libVersion = '13' +} + +apply from: "$rootDir/common.gradle" diff --git a/src/de/cinemathek/res/mipmap-hdpi/ic_launcher.png b/src/de/cinemathek/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..b821b0723 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/de/cinemathek/res/mipmap-hdpi/ic_launcher_adaptive_back.png b/src/de/cinemathek/res/mipmap-hdpi/ic_launcher_adaptive_back.png new file mode 100644 index 000000000..8dc560dd4 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-hdpi/ic_launcher_adaptive_back.png differ diff --git a/src/de/cinemathek/res/mipmap-hdpi/ic_launcher_adaptive_fore.png b/src/de/cinemathek/res/mipmap-hdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 000000000..fe053c9f6 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-hdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/de/cinemathek/res/mipmap-mdpi/ic_launcher.png b/src/de/cinemathek/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..976905b69 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/de/cinemathek/res/mipmap-mdpi/ic_launcher_adaptive_back.png b/src/de/cinemathek/res/mipmap-mdpi/ic_launcher_adaptive_back.png new file mode 100644 index 000000000..f8feb6e59 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-mdpi/ic_launcher_adaptive_back.png differ diff --git a/src/de/cinemathek/res/mipmap-mdpi/ic_launcher_adaptive_fore.png b/src/de/cinemathek/res/mipmap-mdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 000000000..bde9fb293 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-mdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher.png b/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..1c4e954ff Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher_adaptive_back.png b/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher_adaptive_back.png new file mode 100644 index 000000000..1b560124d Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher_adaptive_back.png differ diff --git a/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png b/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 000000000..a3747f4bf Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher.png b/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..22544baad Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png b/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png new file mode 100644 index 000000000..369383ac8 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png differ diff --git a/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png b/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 000000000..e26743f16 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher.png b/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..72a8cef0a Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png b/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png new file mode 100644 index 000000000..de26e98f5 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png differ diff --git a/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png b/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 000000000..6b899ae78 Binary files /dev/null and b/src/de/cinemathek/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/de/cinemathek/src/eu/kanade/tachiyomi/animeextension/de/cinemathek/Cinemathek.kt b/src/de/cinemathek/src/eu/kanade/tachiyomi/animeextension/de/cinemathek/Cinemathek.kt new file mode 100644 index 000000000..27d1ec521 --- /dev/null +++ b/src/de/cinemathek/src/eu/kanade/tachiyomi/animeextension/de/cinemathek/Cinemathek.kt @@ -0,0 +1,195 @@ +package eu.kanade.tachiyomi.animeextension.de.cinemathek + +import android.app.Application +import android.content.SharedPreferences +import androidx.preference.ListPreference +import androidx.preference.PreferenceScreen +import eu.kanade.tachiyomi.animeextension.de.cinemathek.extractors.StreamlareExtractor +import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource +import eu.kanade.tachiyomi.animesource.model.AnimeFilterList +import eu.kanade.tachiyomi.animesource.model.SAnime +import eu.kanade.tachiyomi.animesource.model.SEpisode +import eu.kanade.tachiyomi.animesource.model.Video +import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.POST +import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get +import kotlin.Exception + +class Cinemathek : ConfigurableAnimeSource, ParsedAnimeHttpSource() { + + override val name = "Cinemathek" + + override val baseUrl = "https://cinemathek.net" + + override val lang = "de" + + override val supportsLatest = false + + override val client: OkHttpClient = network.cloudflareClient + + private val preferences: SharedPreferences by lazy { + Injekt.get().getSharedPreferences("source_$id", 0x0000) + } + + // Popular Anime + + override fun popularAnimeSelector(): String = "article.movies" + + override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/movies/page/$page/") + + override fun popularAnimeFromElement(element: Element): SAnime { + val anime = SAnime.create() + anime.setUrlWithoutDomain(element.select("div.poster a").attr("href")) + anime.title = element.select("div.data h3").text() + anime.thumbnail_url = element.select("div.poster img").attr("src") + return anime + } + + override fun popularAnimeNextPageSelector(): String = ".arrow_pag" + + // Episodes + + override fun episodeListSelector() = throw Exception("not used") + + override fun episodeListParse(response: Response): List { + val document = response.asJsoup() + val episodeList = mutableListOf() + val episode = SEpisode.create() + episode.name = document.select("div.data > h1").text() + episode.episode_number = 1F + episode.setUrlWithoutDomain(document.select("link[rel=canonical]").attr("href")) + episodeList.add(episode) + return episodeList.reversed() + } + + override fun episodeFromElement(element: Element): SEpisode = throw Exception("not Used") + + // Video urls + + override fun videoListSelector(): String = throw Exception("not Used") + + override fun videoListParse(response: Response): List