-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli_debrid.spec
152 lines (140 loc) · 3.78 KB
/
cli_debrid.spec
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# -*- mode: python ; coding: utf-8 -*-
import os
import shutil
from PyInstaller.config import CONF
block_cipher = None
# Get the path to your project directory
project_path = CONF['specpath']
# Collect all files in the project directory
added_files = []
for root, dirs, files in os.walk(project_path):
if '.git' in dirs:
dirs.remove('.git') # don't visit git directories
if '__pycache__' in dirs:
dirs.remove('__pycache__') # don't visit pycache directories
if 'logs' in dirs:
dirs.remove('logs') # don't include log files
if 'flask_session' in dirs:
dirs.remove('flask_session') # don't include flask session files
for file in files:
if file.endswith(('.py', '.json', '.txt', '.html', '.css', '.js', '.png', '.ico', '.gif', '.webmanifest')):
file_path = os.path.join(root, file)
relative_path = os.path.relpath(file_path, project_path)
target_dir = os.path.dirname(relative_path)
# Use '.' as the destination directory if target_dir is empty
dest_dir = '.' if target_dir == '' else target_dir
added_files.append((file_path, dest_dir))
# Ensure main.py is included
main_py = os.path.join(project_path, 'main.py')
if os.path.exists(main_py):
added_files.append((main_py, '.'))
a = Analysis(
['windows_wrapper.py'],
pathex=[project_path],
binaries=[],
datas=added_files,
hiddenimports=[
'requests',
'urllib3',
'chardet',
'certifi',
'idna',
'charset_normalizer',
'requests.packages.urllib3',
'requests.packages.urllib3.util',
'requests.packages.urllib3.contrib',
'pip',
'click',
'flask',
'werkzeug',
'flask_session',
'flask_cors',
'flask_login',
'flask_sqlalchemy',
'sqlalchemy',
'aiohttp',
'babelfish',
'bs4',
'bencode',
'fuzzywuzzy',
'grpc',
'guessit',
'markupsafe',
'protobuf',
'pykakasi',
'tenacity',
'urwid',
'pytrakt',
'plexapi',
'colorlog',
'iso8601',
'PIL',
'supervisor',
'ntplib',
'parsett',
'pytz',
'psutil',
'api_tracker',
'config_manager',
'database',
'debrid',
'extensions',
'initialization',
'logging_config',
'manual_blacklist',
'metadata',
'notifications',
'not_wanted_magnets',
'poster_cache',
'queue_manager',
'queue_utils',
'reverse_parser',
'run_program',
'scraper',
'settings',
'template_utils',
'wake_count_manager',
'web_scraper',
'web_server',
],
hookspath=['hooks'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='cli_debrid',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
# Clean up the dist directory
dist_dir = os.path.join(CONF['distpath'], 'cli_debrid')
if os.path.exists(dist_dir):
shutil.rmtree(dist_dir, ignore_errors=True)
# Ensure the directory is created
os.makedirs(dist_dir, exist_ok=True)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='cli_debrid',
)