diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3ff59515ed7..02bf502aba9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -57,6 +57,7 @@ + diff --git a/app/src/main/java/com/lagradost/cloudstream3/actions/VideoClickAction.kt b/app/src/main/java/com/lagradost/cloudstream3/actions/VideoClickAction.kt index fb5be07eb21..6501868f6bb 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/actions/VideoClickAction.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/actions/VideoClickAction.kt @@ -15,6 +15,7 @@ import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.actions.temp.BiglyBTPackage import com.lagradost.cloudstream3.actions.temp.CopyClipboardAction import com.lagradost.cloudstream3.actions.temp.JustPlayerPackage +import com.lagradost.cloudstream3.actions.temp.KodiPackage import com.lagradost.cloudstream3.actions.temp.LibreTorrentPackage import com.lagradost.cloudstream3.actions.temp.MpvExPackage import com.lagradost.cloudstream3.actions.temp.MpvKtPackage @@ -45,6 +46,10 @@ import java.util.concurrent.Callable import java.util.concurrent.FutureTask object VideoClickActionHolder { + /** + * To avoid supporting malicious apps, we have a requirement on the app + * being open source, popular and not brand new. + */ val allVideoClickActions = atomicListOf( // Default PlayInBrowserAction(), @@ -52,21 +57,98 @@ object VideoClickActionHolder { ViewM3U8Action(), PlayMirrorAction(), // main support external apps + /** + * Source: https://github.com/videolan/vlc-android/ + * Stars: 4.1k + * Date: Jul 2, 2012 + */ VlcPackage(), + /** + * Source: https://github.com/mpv-android/mpv-android/ + * Stars: 3.7k + * Date: Apr 20, 2016 + */ MpvPackage(), + /** + * Source: https://github.com/xbmc/xbmc/ + * Stars: 21.5k + * Date: Oct 1, 2013 + */ + KodiPackage, + /** + * Source: https://github.com/marlboro-advance/mpvEx/ + * Stars: 2.8k + * Date: Nov 12, 2025 + */ MpvExPackage(), + /** + * Source: https://github.com/anilbeesetti/nextplayer/ + * Stars: 4.7k + * Date: May 19, 2023 + */ NextPlayerPackage(), + /** + * Source: https://github.com/moneytoo/Player/ + * Stars: 2.8k + * Date: Nov 16, 2020 + */ JustPlayerPackage(), + /** + * Mirror: https://github.com/futo-org/fcast/ + * Source: https://gitlab.futo.org/videostreaming/fcast/ + * Stars: 700 + * Date: Sep 5, 2024 + */ FcastAction(), + /** + * Source: https://github.com/proninyaroslav/libretorrent/ + * Stars: 4.1k + * Date: Feb 5, 2021 + */ LibreTorrentPackage(), + /** + * Source: https://github.com/BiglySoftware/BiglyBT-Android/ + * Stars: 500 + * Date: Nov 15, 2017 + */ BiglyBTPackage(), // forks/backup apps + /** + * See VLC + */ VlcNightlyPackage(), + /** + * Source: Proprietary https://www.webvideocaster.com/home/ + * Reason: The built-in video caster is terrible, and no good FOSS alternatives exist. + * If a FOSS caster is found, this should be replaced. + */ WebVideoCastPackage(), + /** + * Source: https://github.com/mpv-android/mpv-android/pull/58/ + * See MPV + */ MpvYTDLPackage(), + /** + * Source: https://github.com/abdallahmehiz/mpvKt/ + * Stars: 1.3k + * Date: Aug 18, 2024 + */ MpvKtPackage(), + /** + * See MPV KT + */ MpvKtPreviewPackage(), + /** + * Source: https://github.com/Kindness-Kismet/only_player/ + * Stars: 500 + * Date: Mar 8, 2026 + */ OnlyPlayer(), + /** + * Source: https://github.com/Riteshp2001/mpvRx/ + * Stars: 900 + * Date: Apr 29, 2026 + */ MpvRxPackage(), // Always Ask option AlwaysAskAction(), diff --git a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/KodiPackage.kt b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/KodiPackage.kt new file mode 100644 index 00000000000..d64bb2cea29 --- /dev/null +++ b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/KodiPackage.kt @@ -0,0 +1,43 @@ +package com.lagradost.cloudstream3.actions.temp + +import android.app.Activity +import android.content.Context +import android.content.Intent +import androidx.core.net.toUri +import com.lagradost.cloudstream3.actions.OpenInAppAction +import com.lagradost.cloudstream3.ui.result.LinkLoadingResult +import com.lagradost.cloudstream3.ui.result.ResultEpisode +import com.lagradost.cloudstream3.utils.txt + +/** + * https://github.com/xbmc/xbmc/ + * https://github.com/xbmc/xbmc/blob/6a524b06c89168708a9486e01d0125b03737d1f6/tools/android/packaging/xbmc/src/Main.java.in#L64 + * https://github.com/xbmc/xbmc/blob/6a524b06c89168708a9486e01d0125b03737d1f6/xbmc/platform/android/activity/XBMCApp.cpp#L1382 + */ +object KodiPackage : OpenInAppAction( + appName = txt("Kodi"), + packageName = "org.xbmc.kodi", + intentClass = "org.xbmc.kodi.Splash" +) { + override val oneSource: Boolean = true + override suspend fun putExtra( + context: Context, + intent: Intent, + video: ResultEpisode, + result: LinkLoadingResult, + index: Int? + ) { + val link = result.links[index!!] + val headers = link.getAllHeaders() + /** See https://kodi.wiki/view/HTTP */ + if (headers.isNotEmpty()) { + intent.data = "${link.url}|${ + headers.map { "${it.key}=${it.value}" }.joinToString(separator = "&") + }".toUri() + } else { + intent.data = link.url.toUri() + } + } + + override fun onResult(activity: Activity, intent: Intent?) = Unit +} \ No newline at end of file