-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
35 lines (30 loc) · 995 Bytes
/
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
import asyncio
from anime_downloader import link
from anime_downloader import search
import subprocess
import os
def clear_screen():
if os.name == 'nt': # For Windows
subprocess.run(['cls'], shell=True)
else: # For Unix/Linux/Mac
subprocess.run(['clear'])
async def download_episode():
try:
while True:
print("How would you like to download the episode?")
print("1. Search for episode")
print("2. Direct download link")
choice = input("Enter your choice (1 or 2): ").strip()
if choice == "1":
clear_screen()
await search()
elif choice == "2":
clear_screen()
await link()
else:
print("Invalid choice. Please enter '1' or '2'.")
except KeyboardInterrupt:
print("\nExiting...")
return
if __name__ == "__main__":
asyncio.run(download_episode())