forked from FudgeRK/MyfansDownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
46 lines (31 loc) · 1.04 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import sys
import subprocess
from helpers.deps import install_requirements, check_python_version, check_ffmpeg_installed
def option1():
subprocess.run([sys.executable, "scripts/myfans_scrap.py"])
def option2():
subprocess.run([sys.executable, "scripts/myfans_dl.py"])
def option3():
subprocess.run([sys.executable, "scripts/myfans_image_dl.py"])
def main():
# Check if the required packages are installed and if ffmpeg is installed.
if not install_requirements() and check_ffmpeg_installed():
sys.exit(1)
options = {
"1": option1,
"2": option2,
"3": option3
}
print("Choose an option:")
print("1. Scrap post id")
print("2. Download videos")
print("3. Download images")
choice = input("Enter your choice (1, 2 or 3): ")
action = options.get(choice)
if action:
action()
else:
print("Invalid choice. Please enter 1, 2 or 3")
if __name__ == "__main__":
if check_python_version():
main()