fix: remove vlc output

This commit is contained in:
starnakin 2023-05-15 13:51:20 +02:00
parent 9f237c71c8
commit 04f8695333

View File

@ -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