diff --git a/src/en/animerush/AndroidManifest.xml b/src/en/animerush/AndroidManifest.xml new file mode 100644 index 000000000..acb4de356 --- /dev/null +++ b/src/en/animerush/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/en/animerush/build.gradle b/src/en/animerush/build.gradle new file mode 100644 index 000000000..acd2ef924 --- /dev/null +++ b/src/en/animerush/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + extName = 'Animerush' + pkgNameSuffix = 'en.animerush' + extClass = '.Animerush' + extVersionCode = 1 + libVersion = '13' +} + +apply from: "$rootDir/common.gradle" diff --git a/src/en/animerush/res/mipmap-hdpi/ic_launcher.png b/src/en/animerush/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..f4de6af1e Binary files /dev/null and b/src/en/animerush/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/en/animerush/res/mipmap-hdpi/ic_launcher_background.png b/src/en/animerush/res/mipmap-hdpi/ic_launcher_background.png new file mode 100644 index 000000000..2d07511b8 Binary files /dev/null and b/src/en/animerush/res/mipmap-hdpi/ic_launcher_background.png differ diff --git a/src/en/animerush/res/mipmap-hdpi/ic_launcher_foreground.png b/src/en/animerush/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..13e89d5c9 Binary files /dev/null and b/src/en/animerush/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/src/en/animerush/res/mipmap-hdpi/ic_launcher_monochrome.png b/src/en/animerush/res/mipmap-hdpi/ic_launcher_monochrome.png new file mode 100644 index 000000000..13e89d5c9 Binary files /dev/null and b/src/en/animerush/res/mipmap-hdpi/ic_launcher_monochrome.png differ diff --git a/src/en/animerush/res/mipmap-mdpi/ic_launcher.png b/src/en/animerush/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..df858bded Binary files /dev/null and b/src/en/animerush/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/en/animerush/res/mipmap-mdpi/ic_launcher_background.png b/src/en/animerush/res/mipmap-mdpi/ic_launcher_background.png new file mode 100644 index 000000000..09b41700c Binary files /dev/null and b/src/en/animerush/res/mipmap-mdpi/ic_launcher_background.png differ diff --git a/src/en/animerush/res/mipmap-mdpi/ic_launcher_foreground.png b/src/en/animerush/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..b2c385525 Binary files /dev/null and b/src/en/animerush/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/src/en/animerush/res/mipmap-mdpi/ic_launcher_monochrome.png b/src/en/animerush/res/mipmap-mdpi/ic_launcher_monochrome.png new file mode 100644 index 000000000..b2c385525 Binary files /dev/null and b/src/en/animerush/res/mipmap-mdpi/ic_launcher_monochrome.png differ diff --git a/src/en/animerush/res/mipmap-xhdpi/ic_launcher.png b/src/en/animerush/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..e901d3504 Binary files /dev/null and b/src/en/animerush/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/en/animerush/res/mipmap-xhdpi/ic_launcher_background.png b/src/en/animerush/res/mipmap-xhdpi/ic_launcher_background.png new file mode 100644 index 000000000..ea00baaf9 Binary files /dev/null and b/src/en/animerush/res/mipmap-xhdpi/ic_launcher_background.png differ diff --git a/src/en/animerush/res/mipmap-xhdpi/ic_launcher_foreground.png b/src/en/animerush/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..94b82c868 Binary files /dev/null and b/src/en/animerush/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/src/en/animerush/res/mipmap-xhdpi/ic_launcher_monochrome.png b/src/en/animerush/res/mipmap-xhdpi/ic_launcher_monochrome.png new file mode 100644 index 000000000..94b82c868 Binary files /dev/null and b/src/en/animerush/res/mipmap-xhdpi/ic_launcher_monochrome.png differ diff --git a/src/en/animerush/res/mipmap-xxhdpi/ic_launcher.png b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..0340d93a3 Binary files /dev/null and b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_background.png b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_background.png new file mode 100644 index 000000000..adcd3c25e Binary files /dev/null and b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_background.png differ diff --git a/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_foreground.png b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..fb760d5fe Binary files /dev/null and b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_monochrome.png new file mode 100644 index 000000000..fb760d5fe Binary files /dev/null and b/src/en/animerush/res/mipmap-xxhdpi/ic_launcher_monochrome.png differ diff --git a/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher.png b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..d725ddbf4 Binary files /dev/null and b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_background.png b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_background.png new file mode 100644 index 000000000..08eb24e0c Binary files /dev/null and b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_background.png differ diff --git a/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..aae6c575e Binary files /dev/null and b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_monochrome.png new file mode 100644 index 000000000..aae6c575e Binary files /dev/null and b/src/en/animerush/res/mipmap-xxxhdpi/ic_launcher_monochrome.png differ diff --git a/src/en/animerush/src/eu/kanade/tachiyomi/animeextension/en/animerush/Animerush.kt b/src/en/animerush/src/eu/kanade/tachiyomi/animeextension/en/animerush/Animerush.kt new file mode 100644 index 000000000..58a19f4fb --- /dev/null +++ b/src/en/animerush/src/eu/kanade/tachiyomi/animeextension/en/animerush/Animerush.kt @@ -0,0 +1,236 @@ +package eu.kanade.tachiyomi.animeextension.en.animerush + +import android.app.Application +import android.content.SharedPreferences +import android.os.Build +import android.text.Html +import androidx.annotation.RequiresApi +import androidx.preference.PreferenceScreen +import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource +import eu.kanade.tachiyomi.animesource.model.AnimeFilter +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.util.asJsoup +import okhttp3.Headers +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.OkHttpClient +import okhttp3.Request +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 Animerush : ConfigurableAnimeSource, ParsedAnimeHttpSource() { + + override val name = "Animerush" + + override val baseUrl = "https://www.animerush.tv" + + override val lang = "en" + + 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 = "div#popular ul li a" + + override fun popularAnimeRequest(page: Int): Request = GET(baseUrl) + + override fun popularAnimeFromElement(element: Element): SAnime { + val anime = SAnime.create() + anime.setUrlWithoutDomain(element.attr("href")) + anime.title = element.select("img").attr("title") + anime.thumbnail_url = baseUrl + element.select("img").attr("src") + return anime + } + + override fun popularAnimeNextPageSelector(): String? = null + + // Episodes + + override fun episodeListSelector() = throw Exception("not used") + + override fun episodeListParse(response: Response): List { + val document = response.asJsoup() + val episodeList = mutableListOf() + val epElements = document.select("div.desc_box_mid div.episode_list") + epElements.forEach { + val episode = episodeFromElement(it) + episodeList.add(episode) + } + return episodeList + } + + override fun episodeFromElement(element: Element): SEpisode { + val episode = SEpisode.create() + episode.episode_number = element.select("a.fixedLinkColor").attr("title").substringAfter("Episode ").toFloat() + episode.name = element.select("a.fixedLinkColor").attr("title") + episode.setUrlWithoutDomain(element.select("a.fixedLinkColor").attr("href")) + return episode + } + + // Video urls + + @RequiresApi(Build.VERSION_CODES.N) + override fun videoListParse(response: Response): List