]>
Commit | Line | Data |
---|---|---|
a1b77842 | 1 | #!/usr/bin/env python3 |
2 | ||
3 | # Allow execution from anywhere | |
4 | import os | |
5 | import sys | |
6 | ||
7 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
8 | ||
9 | import warnings | |
10 | ||
11 | from py2exe import freeze | |
12 | ||
13 | from devscripts.utils import read_version | |
14 | ||
15 | VERSION = read_version() | |
16 | ||
17 | ||
18 | def main(): | |
19 | warnings.warn( | |
20 | 'py2exe builds do not support pycryptodomex and needs VC++14 to run. ' | |
21 | 'It is recommended to run "pyinst.py" to build using pyinstaller instead') | |
22 | ||
615a8444 | 23 | freeze( |
a1b77842 | 24 | console=[{ |
25 | 'script': './yt_dlp/__main__.py', | |
26 | 'dest_base': 'yt-dlp', | |
27 | 'icon_resources': [(1, 'devscripts/logo.ico')], | |
28 | }], | |
29 | version_info={ | |
30 | 'version': VERSION, | |
388c979a | 31 | 'description': 'A feature-rich command-line audio/video downloader', |
a1b77842 | 32 | 'comments': 'Official repository: <https://github.com/yt-dlp/yt-dlp>', |
33 | 'product_name': 'yt-dlp', | |
34 | 'product_version': VERSION, | |
35 | }, | |
36 | options={ | |
37 | 'bundle_files': 0, | |
38 | 'compressed': 1, | |
39 | 'optimize': 2, | |
40 | 'dist_dir': './dist', | |
41 | 'excludes': [ | |
42 | # py2exe cannot import Crypto | |
43 | 'Crypto', | |
44 | 'Cryptodome', | |
45 | # py2exe appears to confuse this with our socks library. | |
46 | # We don't use pysocks and urllib3.contrib.socks would fail to import if tried. | |
47 | 'urllib3.contrib.socks' | |
48 | ], | |
49 | 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'], | |
50 | # Modules that are only imported dynamically must be added here | |
51 | 'includes': ['yt_dlp.compat._legacy', 'yt_dlp.compat._deprecated', | |
52 | 'yt_dlp.utils._legacy', 'yt_dlp.utils._deprecated'], | |
53 | }, | |
54 | zipfile=None, | |
55 | ) | |
56 | ||
57 | ||
58 | if __name__ == '__main__': | |
59 | main() |