MCPcopy Index your code
hub / github.com/elebumm/RedditVideoMakerBot / ffmpeg_install

Function ffmpeg_install

utils/ffmpeg_install.py:104–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103
104def ffmpeg_install():
105 try:
106 # Try to run the FFmpeg command
107 subprocess.run(
108 ["ffmpeg", "-version"],
109 check=True,
110 stdout=subprocess.PIPE,
111 stderr=subprocess.PIPE,
112 )
113 except FileNotFoundError:
114 # Check if there's ffmpeg.exe in the current directory
115 if os.path.exists("./ffmpeg.exe"):
116 print(
117 "FFmpeg is installed on this system! If you are seeing this error for the second time, restart your computer."
118 )
119 print("FFmpeg is not installed on this system.")
120 resp = input(
121 "We can try to automatically install it for you. Would you like to do that? (y/n): "
122 )
123 if resp.lower() == "y":
124 print("Installing FFmpeg...")
125 if os.name == "nt":
126 ffmpeg_install_windows()
127 elif os.name == "posix":
128 ffmpeg_install_linux()
129 elif os.name == "mac":
130 ffmpeg_install_mac()
131 else:
132 print("Your OS is not supported. Please install FFmpeg manually and try again.")
133 exit()
134 else:
135 print("Please install FFmpeg manually and try again.")
136 exit()
137 except Exception as e:
138 print(
139 "Welcome fellow traveler! You're one of the few who have made it this far. We have no idea how you got at this error, but we're glad you're here. Please report this error to the developer, and we'll try to fix it as soon as possible. Thank you for your patience!"
140 )
141 print(e)
142 return None

Callers 1

main.pyFile · 0.90

Calls 4

ffmpeg_install_windowsFunction · 0.85
ffmpeg_install_linuxFunction · 0.85
ffmpeg_install_macFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected