mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-25 20:34:26 -08:00
24 lines
526 B
Python
24 lines
526 B
Python
import shutil
|
|
import subprocess
|
|
|
|
|
|
def mpv(link, title: None | str = "anime", *custom_args):
|
|
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])
|