mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-01-01 23:39:54 -08:00
feat: make the mpv player module work on android
This commit is contained in:
@@ -5,6 +5,19 @@ import subprocess
|
||||
def mpv(link, title, *custom_args):
|
||||
MPV = shutil.which("mpv")
|
||||
if not MPV:
|
||||
print("mpv not found")
|
||||
return
|
||||
subprocess.run([MPV, *custom_args, f"--title={title}", link])
|
||||
args = [
|
||||
"nohup",
|
||||
"am",
|
||||
"start",
|
||||
"--user",
|
||||
"0",
|
||||
"-a",
|
||||
"android.intent.action.VIEW",
|
||||
"-d",
|
||||
link,
|
||||
"-n",
|
||||
"is.xyz.mpv/.MPVActivity",
|
||||
]
|
||||
subprocess.run(args)
|
||||
else:
|
||||
subprocess.run([MPV, *custom_args, f"--title={title}", link])
|
||||
|
||||
Reference in New Issue
Block a user