fix: remove vlc output
This commit is contained in:
parent
9f237c71c8
commit
04f8695333
4
main.py
4
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
|
||||
|
Loading…
Reference in New Issue
Block a user