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 tinydb import TinyDB, Query
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
import requests import requests
import os
from simple_term_menu import TerminalMenu from simple_term_menu import TerminalMenu
import subprocess
db = TinyDB("./database.json", indent=4) db = TinyDB("./database.json", indent=4)
query = Query() query = Query()
@ -43,7 +43,7 @@ while True:
lst.append(element.text) lst.append(element.text)
terminal_menu = TerminalMenu(lst) terminal_menu = TerminalMenu(lst)
file = soup.findAll("a")[terminal_menu.show()]["href"] file = soup.findAll("a")[terminal_menu.show()]["href"]
url = url + file
if (not file.endswith("/")): if (not file.endswith("/")):
print(f"vlc '{url}'") subprocess.run(f"vlc '{url + file}'", shell=True)
os.system(f"vlc '{url}'") else:
url = url + file