diff --git a/main.py b/main.py index b4f4958..c643c13 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,8 @@ from tinydb import TinyDB, Query from bs4 import BeautifulSoup import requests -import os from simple_term_menu import TerminalMenu +import subprocess db = TinyDB("./database.json", indent=4) query = Query() @@ -43,7 +43,7 @@ while True: lst.append(element.text) terminal_menu = TerminalMenu(lst) file = soup.findAll("a")[terminal_menu.show()]["href"] - url = url + file if (not file.endswith("/")): - print(f"vlc '{url}'") - os.system(f"vlc '{url}'") + subprocess.run(f"vlc '{url + file}'", shell=True) + else: + url = url + file