mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-25 12:24:52 -08:00
28 lines
527 B
Python
28 lines
527 B
Python
import shutil
|
|
import subprocess
|
|
|
|
|
|
def mpv(
|
|
link,
|
|
*custom_args,
|
|
title="anime",
|
|
):
|
|
MPV = shutil.which("mpv")
|
|
if not MPV:
|
|
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])
|