diff --git a/main.py b/main.py index c491529..79a1a21 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,4 @@ import argparse -import os -import subprocess from enums import Mode, Info from tiktokbot import TikTok @@ -9,22 +7,6 @@ def banner() -> None: print(Info.BANNER) -def check_requires(): - - with open(os.devnull) as devnull: - # check ffmpeg - try: - subprocess.call(["ffmpeg", "-version"], stdout=devnull, stderr=devnull) - except FileNotFoundError as ex: - raise FileNotFoundError("[-] Ffmpeg not installed. https://phoenixnap.com/kb/ffmpeg-windows") - - # check youtube-dl - try: - subprocess.call(["youtube-dl", "--version"], stdout=devnull, stderr=devnull) - except FileNotFoundError as ex: - raise FileNotFoundError("[-] youtube-dl not installed. Run: pip install youtube-dl or https://github.com/ytdl-org/youtube-dl#installation\n") - - def parse_args(): parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) diff --git a/requirements.txt b/requirements.txt index bfb1849..9fc6182 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ requests argparse -youtube-dl \ No newline at end of file +streamlink \ No newline at end of file diff --git a/tiktokbot.py b/tiktokbot.py index 1b8a25e..5bf4760 100644 --- a/tiktokbot.py +++ b/tiktokbot.py @@ -56,7 +56,8 @@ def start_recording(self): print("\n[*] STARTED RECORDING... [PRESS ONLY ONCE CTRL + C TO STOP]") - cmd = f"youtube-dl --hls-prefer-ffmpeg --no-continue --no-part -o {output} {live_url}" + cmd = f"streamlink {live_url} best -o {output}" + #cmd = f"youtube-dl --hls-prefer-ffmpeg --no-continue --no-part -o {output} {live_url}" with open("error.log", "w") as error_log, open("info.log", "w") as info: p = subprocess.Popen(cmd, stderr=error_log, stdout=info, shell=True) signal.signal(signal.SIGINT, lambda x, y: sys.exit(0))