Browse Source

Fixed play function

master
Leonie 7 months ago
parent
commit
b314195b5b
1 changed files with 10 additions and 7 deletions
  1. 10
    7
      soundcli.py

+ 10
- 7
soundcli.py View File

@@ -82,13 +82,16 @@ while True:
counter = counter + 1
print(str(counter) + ": " + track.title)
if x.startswith("play "):
thist = None
for track in tracks:
counter = counter + 1
if str(counter) == x.split("play ")[1]:
thist = track
stream_url = client.get(thist.stream_url, allow_redirects=False)
os.system("mpv \"" + stream_url.location + "\"")
try:
thist = None
for track in tracks:
counter = counter + 1
if str(counter) == x.split("play ")[1]:
thist = track
stream_url = client.get(thist.stream_url, allow_redirects=False)
os.system("mpv \"" + stream_url.location + "\"")
except:
error_noquery()
if x == "list" or x == "ls":
if not tracks == None:
for track in tracks:

Loading…
Cancel
Save