command fixes and youtube fixes
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from PyInstaller.utils.hooks import collect_all
|
||||
from PyInstaller.utils.hooks import copy_metadata
|
||||
|
||||
project_root = Path(SPECPATH).resolve()
|
||||
datas = []
|
||||
ffmpeg_path = project_root / 'plugins' / 'ffmpeg-8.0.1' / 'bin' / 'ffmpeg.exe'
|
||||
deno_path = Path(sys.executable).resolve().parent / 'deno.exe'
|
||||
for required_file in (ffmpeg_path, deno_path):
|
||||
if not required_file.is_file():
|
||||
raise FileNotFoundError(f'Erforderliche Build-Datei fehlt: {required_file}')
|
||||
binaries = [
|
||||
(str(ffmpeg_path), 'plugins\\ffmpeg-8.0.1\\bin'),
|
||||
(str(deno_path), '.'),
|
||||
]
|
||||
hiddenimports = ['discord', 'discord.ext.commands', 'yt_dlp']
|
||||
avatar_dir = project_root / 'avatars'
|
||||
if avatar_dir.exists():
|
||||
datas.append((str(avatar_dir), 'avatars'))
|
||||
datas += copy_metadata('discord.py')
|
||||
datas += copy_metadata('yt-dlp')
|
||||
datas += copy_metadata('yt-dlp-ejs')
|
||||
datas += copy_metadata('PyNaCl')
|
||||
datas += copy_metadata('davey')
|
||||
tmp_ret = collect_all('discord')
|
||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||
tmp_ret = collect_all('yt_dlp')
|
||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||
tmp_ret = collect_all('yt_dlp_ejs')
|
||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||
tmp_ret = collect_all('nacl')
|
||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||
tmp_ret = collect_all('davey')
|
||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
pathex=[],
|
||||
binaries=binaries,
|
||||
datas=datas,
|
||||
hiddenimports=hiddenimports,
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
exclude_binaries=True,
|
||||
name='Radio-Bot',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
name='Radio-Bot',
|
||||
)
|
||||
Reference in New Issue
Block a user