Commit a9ca5a3f9c
Unsigned
Layout: unified · split
start_video.py +11 −3
| @@ -3,12 +3,20 @@ import json | ||
| 3 | 3 | import socket |
| 4 | 4 | import subprocess |
| 5 | 5 | |
| 6 | def 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}"]) | |
| 6 | def 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]) | |
| 9 | 15 | # os.system() |
| 10 | 16 | # Path to the MPV socket |
| 11 | 17 | # socket_path = f'/tmp/mpvsocket{salt}' |
| 12 | 18 | # Connect to the MPV IPC socket |
| 13 | 19 | # client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
| 14 | 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 | ||