-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyinst.py
35 lines (30 loc) · 941 Bytes
/
pyinst.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
import sys
from pathlib import Path
from PyInstaller.__main__ import run
from yt_dlp.extractor import gen_extractor_classes
BASE_PATH = Path(__file__).parent
exclusions = [
"cffi", # imported by Crypto
"Crypto", # imported by yt_dlp
"Cryptodome", # same thing
"cryptography", # same thing
"matplotlib", # imported by tqdm
"numpy", # same thing
"pandas", # same thing
"statistics", # imported by random
*(extr._module for extr in gen_extractor_classes() if "youtube" not in extr._module),
]
exclusions_args = []
for excl in exclusions:
exclusions_args.append("--exclude-module")
exclusions_args.append(excl)
system_suffix = "windows" if sys.platform == "win32" else "macos" if sys.platform == "darwin" else "linux"
run(
[
"--onefile",
"--name",
"songs-dl-" + system_suffix,
*exclusions_args,
str(BASE_PATH / "songs_dl/__main__.py"),
]
)