mirror of
https://gitgud.io/Melon__Bread/auto-ttv-grabber.git
synced 2024-11-24 16:28:30 -05:00
Fixed formatting and now logs output of dl-stream
This commit is contained in:
parent
43c07186df
commit
0e64f7477b
16
main.py
16
main.py
@ -1,22 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import time
|
||||
import requests
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
import requests
|
||||
|
||||
channel_list = []
|
||||
downloading = []
|
||||
|
||||
|
||||
def download_stream(channel):
|
||||
downloading.append(channel)
|
||||
# TODO: Output dl-stream to a log file
|
||||
with open("log.txt", "w") as log:
|
||||
subprocess.Popen(
|
||||
["dl-stream", "-r", channel], start_new_session=True, stdout=subprocess.DEVNULL
|
||||
["dl-stream", "-r", channel], start_new_session=True, stdout=log
|
||||
)
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ while True:
|
||||
else:
|
||||
print(channel + " is already downloading")
|
||||
else:
|
||||
print(channel + " is \033[31mnot live\033[0m.")
|
||||
print("\033[1m" + channel + "\033[0m is \033[31mnot live\033[0m.")
|
||||
if channel in downloading:
|
||||
downloading.remove(channel)
|
||||
print(channel + " is no longer downloading")
|
||||
|
Loading…
Reference in New Issue
Block a user