-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
42 lines (32 loc) · 1.09 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
import Database
from HTMLGet import Connection
import Global
if Global.site == 2:
from ggto import create_list
else:
from ggsh import create_list
def download_cmd():
released_anime = create_list()
for anime in released_anime:
if anime.list_type == 'pref_list':
if ( anime.episode_no > Database.pref_anime[anime.name] ): # Checking if the episode number of the released anime is newer than what i had previously downloaded
print("Downloading", anime.name)
downloaded = anime.download()
if downloaded:
Database.increment(anime.name, anime.episode_no)
elif anime.list_type == False:
print("\nThe anime " + anime.name + " is not in any list")
print("Which list should it be added to?:")
print("1.Preference List\n2.Black List\n")
input_ = input()
if input_ == '1':
Database.add_to_whitelist(anime)
print("Download now? (y/n):")
input_ = input()
if input_ == 'y':
anime.download()
elif input_ == '2':
Database.add_to_blacklist(anime)
if __name__ == "__main__":
download_cmd()
# tree.xpath("//div[@id='videoDownload']//td/a/@href'") aaa