forked from zoexmh99/wvd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.py
86 lines (73 loc) · 2.9 KB
/
plugin.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
77
78
79
80
81
82
83
84
85
86
import os, sys, traceback
from framework import app, path_data, path_app_root, celery, db, SystemModelSetting, socketio, scheduler
from plugin import get_model_setting, Logic, default_route, PluginUtil, LogicModuleBase
class P(object):
package_name = __name__.split('.')[0]
from framework.logger import get_logger
logger = get_logger(package_name)
from flask import Blueprint
blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join(os.path.dirname(__file__), 'templates'))
menu = {
'main' : [package_name, 'widevine 다운로드'],
'sub' : [
['server', '서버'], ['client', '클라이언트'], ['download', '다운로드'], ['auto', '자동'], ['manual', '매뉴얼'], ['log', '로그']
],
'category' : 'tool',
'sub2' : {
'server' : [
['setting', '서버 설정']
],
'client' : [
['setting', '클라이언트 설정'],
],
'download' : [
['list', '목록'], ['setting', '설정'],
],
'auto' : [
['setting', '설정'], ['list', '목록'],
],
'manual' : [
['README.md', 'README'], ['site.md', '사이트별 특징'],
],
}
}
plugin_info = {
'version' : '1.2',
'name' : package_name,
'category_name' : 'tool',
'icon' : '',
'developer' : 'soju6jan',
'description' : 'DRM 영상 다운로드',
'home' : 'https://github.com/soju6jan/%s' % package_name,
'more' : '',
'policy_level' : 5,
'dependency' : [
{
'name' : 'lib_chromedriver_with_browsermob',
'home' : 'https://github.com/soju6jan/lib_chromedriver_with_browsermob',
}
]
}
ModelSetting = get_model_setting(package_name, logger)
logic = None
module_list = None
home_module = 'client'
from tool_base import d
logger = P.logger
package_name = P.package_name
ModelSetting = P.ModelSetting
def initialize():
try:
app.config['SQLALCHEMY_BINDS'][P.package_name] = 'sqlite:///%s' % (os.path.join(path_data, 'db', '{package_name}.db'.format(package_name=P.package_name)))
PluginUtil.make_info_json(P.plugin_info, __file__)
from .logic_server import LogicServer
from .logic_client import LogicClient
from .logic_download import LogicDownload
from .logic_auto import LogicAuto
P.module_list = [LogicServer(P), LogicClient(P), LogicDownload(P), LogicAuto(P)]
P.logic = Logic(P)
default_route(P)
except Exception as e:
P.logger.error('Exception:%s', e)
P.logger.error(traceback.format_exc())
initialize()