-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
76 lines (63 loc) · 2.75 KB
/
__init__.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from config.Setting import Config
from config.UrlFile import UrlSetting
from osuDownload.ChromedownloadLauncher import chromedownloadLauncher
from osuDownload.PythondownloadLauncher import pythonDownloadLauncher
from osuDownload.getList import getBeatmapList
from osuDownload.getListPP import getBeatmapListPP
from models.getLocalFileName import getLocalFileName
from models.deduplicate import Deduplicate
from models.concat import Concat
import pyttsx3
import os
def init():
path_save = 'download_xml'
if not os.path.exists(path_save):
os.makedirs(path_save)
path_save = 'beatmaps_save'
if not os.path.exists(path_save):
os.makedirs(path_save)
downloadPath = os.path.join(os.getcwd(), path_save)
engine = pyttsx3.init()
engine.setProperty('rate', 120)
Setting = Config()
BaseInfo = UrlSetting()
choice = input('输入0启动下载器\n'
'输入1启动谱面抓取\n'
'输入2启动谱面文件去重(减少重复下载,加快下载速度)\n'
'输入3启动谱面文件拼接(合并多次搜索结果一次性下载)\n')
if choice == '1':
if Setting.WebSelection == 1:
getBeatmapList(download_station=Setting.DownloadStation,
urls=BaseInfo.Urls,
search_url=BaseInfo.SearchUrl[1],
url_name=BaseInfo.urlName[Setting.DownloadStation])
elif Setting.WebSelection == 0:
getBeatmapListPP(download_station=Setting.DownloadStation,
urls=BaseInfo.Urls,
search_url=BaseInfo.SearchUrl[0],
url_name=BaseInfo.urlName[Setting.DownloadStation])
elif choice == '0':
if Setting.DownloadStyle == 0:
filename = getLocalFileName()
chromedownloadLauncher(downloadPath=downloadPath,
waitingTime=Setting.PauseTime,
downloadStation=Setting.DownloadStation,
fileName=filename,
urls=BaseInfo.Urls)
engine.say('下载完成')
engine.runAndWait()
elif Setting.DownloadStyle == 1:
filename = getLocalFileName()
pythonDownloadLauncher(fileName=filename,
fileNumber=Setting.fileNumber,
path=downloadPath)
engine.say('下载完成')
engine.runAndWait()
elif choice == '2':
Deduplicate()
elif choice == '3':
Concat()
else:
init()
if __name__ == '__main__':
init()