Closed TrackLab closed 2 months ago
In downloaded.py at download_and_convert_hls_stream I already determine the ffmpeg path. This should only be 1 more line there with check cmlet and if it responds OK good else throw exit. I can add that when I'm home.
I made this function that checks if any ffmpeg instance (PATH or locally as .exe) returns its version number. In case you need a quick function to call for it.
def is_ffmpeg_installed():
# Attempt to execute ffmpeg
try:
result = subprocess.run(['ffmpeg', '-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return "ffmpeg version" in result.stdout.decode()
except FileNotFoundError:
return False
Which I used in the main, before it checks for season_override. Added in line 59
# Check if FFMPEG is installed before even trying to download episodes
if not is_ffmpeg_installed():
logger.error("FFMPEG is not installed or could not be run. You can download it at https://ffmpeg.org/")
exit()
Feel free to use it, or not lol
Merged the request thank you ^^
Please describe what you want to be added/changed: Literally every single time this gets an update and I pull it in a few folder, I forgot about ffmpeg. Getting only errors about files not being found for the .mp4 Which doesnt really tell you that youre missing FFMPEG.
Possible Solutions if you have any: Im suggesting a simple check/notification when FFMPEG isnt there. Either by checking if ffmpeg.exe is in the src folder, or a overal try/except when trying to load up ffmpeg if its installed as PATH.
And if its not, the user could be notified, asking if FFMPEG is installed, and if not, also post the official FFMPEG link. I might see if I can add this in a fork, but wanted to post a request either way.