fix: programs is reusable after stream

This commit is contained in:
starnakin 2023-05-15 13:41:32 +02:00
parent 9051a25fb8
commit 9f237c71c8

View File

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