-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
37 lines (30 loc) · 1.13 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
import modules
import time
import os
CYAN = "\033[1;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"
def callModules(resp):
start_time = time.time()
url = modules.getUrl()
os.system('clear || cls')
all_volumes_site = modules.filterUrl(url)
listVolumes = modules.getLinks(all_volumes_site)
for volume in listVolumes:
volumeSite = modules.filterUrl(volume['url'])
title = modules.getTitle(volumeSite)
if os.path.isdir(f'novels/{title}') is False:
modules.makeFolder(title)
modules.writeHeader(volumeSite, title)
img = modules.getImageCover(volumeSite)
modules.downloadImageCover(img, title)
modules.download_all_images(volume['links_chapters'], title)
modules.writeSumary(volume['title_chapters'], title)
modules.writeChapter(volume['links_tags'], title, img, resp)
end_time = time.time()
elapsed_time = int(end_time - start_time)
print(f'Tempo decorrido: {CYAN}{elapsed_time}{RESET}s')
if __name__ == '__main__':
resp = modules.menu()
callModules(resp)
print(f'\n\nAll Novels saved in: {GREEN}/novels')