diff --git a/main.py b/main.py index bfad616..3b23016 100755 --- a/main.py +++ b/main.py @@ -1,23 +1,23 @@ #!/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 - subprocess.Popen( - ["dl-stream", "-r", channel], start_new_session=True, stdout=subprocess.DEVNULL - ) + with open("log.txt", "w") as log: + subprocess.Popen( + ["dl-stream", "-r", channel], start_new_session=True, stdout=log + ) # Checks if dl-stream is in the systems path @@ -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")