-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
70 lines (65 loc) · 2.02 KB
/
main.py
File metadata and controls
70 lines (65 loc) · 2.02 KB
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
import sys
import platform
from config import init_config, set_verify, get_config
from platforms.haitu import HaiTuScheduler
from platforms.huaren import HuaRenScheduler
from PySide6.QtWidgets import (
QApplication, QMainWindow, QPushButton,
QLabel, QVBoxLayout, QWidget,
QHBoxLayout, QLineEdit, QButtonGroup, QRadioButton
)
from platforms2.yuny import YunYScheduler
from qt.app import MainWindow
from stores.data import VideoData
def new(data: VideoData):
print('new data', data.uuid)
set_verify(data.verify == "是")
config = get_config()
if data.platform == "华人":
spider = HuaRenScheduler(
data.uuid,
data.host_line,
data.url_line,
data.file_dir,
data.auto_next,
config.app.max_reset,
config.app.max_ts_num,
max_thread_num=config.app.max_thread_num,
auto_remove_ts=config.app.auto_remove_ts,
)
elif data.platform == "云影":
spider = YunYScheduler(
data.uuid,
data.host_line,
data.url_line,
data.file_dir,
data.auto_next,
config.app.max_reset,
config.app.max_ts_num,
max_thread_num=config.app.max_thread_num,
auto_remove_ts=config.app.auto_remove_ts,
)
else:
spider = HaiTuScheduler(
data.uuid,
data.host_line,
data.url_line,
data.file_dir,
data.auto_next,
config.app.max_reset,
config.app.max_ts_num,
max_thread_num=config.app.max_thread_num,
auto_remove_ts=config.app.auto_remove_ts,
)
return spider
if __name__ == '__main__':
system = platform.system()
if system == 'Windows':
f = "config.yaml"
else:
f = "mac_config.yaml"
init_config(f)
app = QApplication(sys.argv)
window = MainWindow("视频下载程序", func=new) # 创建我们自定义的主窗口实例
window.show()
sys.exit(app.exec())