Commit a9ca5a3f9c

a9ca5a3f9ca30fc3295fa8e6759439feb4549ceb

parent: 9515a86bc7

Unsigned

Wraient <wraient.911@gmail.com> · 2024-09-03 20:14 UTC

add arguments to mpv

Layout: unified · split

start_video.py +11 −3
@@ -3,12 +3,20 @@ import json
33import socket
44import subprocess
55
6def start_video(link, salt):
7 # print(f"SALT IS {salt}")
8 subprocess.Popen(['alacritty', '-e', 'bash', '-c', f"mpv --input-ipc-server=/tmp/mpvsocket{salt} {link}"])
6def start_video(link, salt:str, args:list=[]):
7 print(f"SALT IS {salt}")
8
9 args_str = ' '.join(args)
10
11 # Build the complete command string
12 command = f"mpv {args_str} --input-ipc-server=/tmp/mpvsocket{salt} {link}"
13
14 subprocess.Popen(['alacritty', '-e', 'bash', '-c', command])
915 # os.system()
1016 # Path to the MPV socket
1117 # socket_path = f'/tmp/mpvsocket{salt}'
1218 # Connect to the MPV IPC socket
1319 # client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
1420 # client.connect(socket_path)
21
22# start_video("https://video.wixstatic.com/video/36bbae_bef5207b465447f19c0f9366f3ee1c27/720p/mp4/file.mp4", "10", ['--start=100'])
\ No newline at end of file