From 917f7cca9d650e5c8f0ba7f9836ee3d68f7df11a Mon Sep 17 00:00:00 2001 From: ForgQi <34411314+ForgQi@users.noreply.github.com> Date: Sat, 25 May 2024 23:32:53 +0800 Subject: [PATCH] add spec --- biliup.spec | 38 ++++++++++++++++++++++++++++++++++++++ biliup/__main__.py | 10 +++++----- biliup/database/db.py | 2 +- biliup/plugins/general.py | 2 +- 4 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 biliup.spec diff --git a/biliup.spec b/biliup.spec new file mode 100644 index 0000000000..43c222ced8 --- /dev/null +++ b/biliup.spec @@ -0,0 +1,38 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['biliup\\__main__.py'], + pathex=[], + binaries=[], + datas=[('biliup/database/migration/', 'biliup/database/migration/'), ('biliup/web/public/', 'biliup/web/public/')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='biliup', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/biliup/__main__.py b/biliup/__main__.py index 63b739688d..e8c1883ed2 100644 --- a/biliup/__main__.py +++ b/biliup/__main__.py @@ -9,10 +9,10 @@ import biliup.common.reload from biliup.config import config from biliup.database.db import SessionLocal, init -from . import __version__, LOG_CONF -from .common.Daemon import Daemon -from .common.reload import AutoReload -from .common.log import DebugLevelFilter +from biliup import __version__, LOG_CONF +from biliup.common.Daemon import Daemon +from biliup.common.reload import AutoReload +from biliup.common.log import DebugLevelFilter def arg_parser(): @@ -61,7 +61,7 @@ def arg_parser(): async def main(args): - from .app import event_manager + from biliup.app import event_manager event_manager.start() diff --git a/biliup/database/db.py b/biliup/database/db.py index 96a0e3a535..aafc858528 100644 --- a/biliup/database/db.py +++ b/biliup/database/db.py @@ -171,7 +171,7 @@ def process_revision_directives(context, revision, directives): script_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "migration") versions_scripts_path = os.path.join(script_path, 'versions') if not os.path.exists(versions_scripts_path): - os.mkdir(versions_scripts_path, 0o700) + os.makedirs(versions_scripts_path, 0o700) alembic_cfg.set_main_option('script_location', script_path) command.stamp(alembic_cfg, 'head', purge=True) # 将当前标记为最新版 scripts = command.revision( # 自动生成迁移脚本 diff --git a/biliup/plugins/general.py b/biliup/plugins/general.py index b845d5bbba..7e9eed2e4d 100644 --- a/biliup/plugins/general.py +++ b/biliup/plugins/general.py @@ -97,7 +97,7 @@ async def acheck_stream(self, is_check=False): except: handlers = [YDownload(self.fname, self.url, 'mp4'), SDownload(self.fname, self.url, 'flv')] for handler in handlers: - if handler.check_stream(): + if await handler.acheck_stream(): self.handler = handler self.suffix = handler.suffix return True