-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
45 lines (37 loc) · 1.48 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
import logger
import crawler
import userhandler
from tabulate import tabulate
arguments = userhandler.get_parameters()
site = None
for argument, value in arguments:
if argument in ("-h", "--help"):
helptable = [
["-h", "--help", "Shows all parameter options"],
["-m", "--mode", 'Select a mode to run the download'],
["", "getAnime", 'Download a specific anime'],
["", "updateNewEpisodes",
'Update Anime-shows that released new episodes in the last 24 hours'],
["", "getAllSeasonal",
'Update all Anime-shows from the current weekly schedule'],
["", "getAllAnime", 'Update all Anime-shows'],
["", "standard", 'Standardize your anime-libraries for Plex to read'],
["-s", "--site", "Select a site on which you want to download"]
]
print(tabulate(helptable))
elif argument in ("-s", "--site"):
if value == 'subsplease':
site = value
elif argument in ("-m", "--mode"):
if site is None:
site = 'subsplease'
if value == 'getAnime':
crawler.simple_download(site)
elif value == 'updateNewEpisodes':
crawler.update_seasonal(site)
elif value == 'getAllSeasonal':
crawler.download_from_schedule(site)
elif value == "getAllAnime":
crawler.get_all_anime(site)
elif value == 'standard':
crawler.standardize_downloaded()