Skip to content

Commit

Permalink
Added check for where ffmpeg is
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfswolke committed Apr 12, 2024
1 parent 5191614 commit 90a9447
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/logic/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ def download(link, file_name):


def download_and_convert_hls_stream(hls_url, file_name):
if path.exists("ffmpeg.exe"):
ffmpeg_path = "ffmpeg.exe"
elif path.exists("src/ffmpeg.exe"):
ffmpeg_path = "src/ffmpeg.exe"
else:
ffmpeg_path = "ffmpeg"

try:
ffmpeg_cmd = ['ffmpeg', '-i', hls_url, '-c', 'copy', file_name]
ffmpeg_cmd = [ffmpeg_path, '-i', hls_url, '-c', 'copy', file_name]
if platform.system() == "Windows":
subprocess.run(ffmpeg_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else:
Expand Down

0 comments on commit 90a9447

Please sign in to comment.