From 04f86953338860711481bb6eaeb6f4bba0a3f099 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 15 May 2023 13:51:20 +0200 Subject: [PATCH] fix: remove vlc output --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index c643c13..06c9fde 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ from tinydb import TinyDB, Query from bs4 import BeautifulSoup import requests from simple_term_menu import TerminalMenu +import os import subprocess db = TinyDB("./database.json", indent=4) @@ -44,6 +45,7 @@ while True: terminal_menu = TerminalMenu(lst) file = soup.findAll("a")[terminal_menu.show()]["href"] if (not file.endswith("/")): - subprocess.run(f"vlc '{url + file}'", shell=True) + with open(os.devnull, 'wb') as devnull: + subprocess.check_call(['vlc', url + file], stdout=devnull, stderr=subprocess.STDOUT) else: url = url + file