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
3import socket 3import socket
4import subprocess 4import subprocess
5 5
6def start_video(link, salt): 6def start_video(link, salt:str, args:list=[]):
7 # print(f"SALT IS {salt}") 7 print(f"SALT IS {salt}")
8 subprocess.Popen(['alacritty', '-e', 'bash', '-c', f"mpv --input-ipc-server=/tmp/mpvsocket{salt} {link}"]) 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])
9 # os.system() 15 # os.system()
10 # Path to the MPV socket 16 # Path to the MPV socket
11 # socket_path = f'/tmp/mpvsocket{salt}' 17 # socket_path = f'/tmp/mpvsocket{salt}'
12 # Connect to the MPV IPC socket 18 # Connect to the MPV IPC socket
13 # client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) 19 # client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
14 # client.connect(socket_path) 20 # 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