]> jfr.im git - yt-dlp.git/blame - bundle/py2exe.py
[ie/mlbtv] Fix extraction (#10296)
[yt-dlp.git] / bundle / py2exe.py
CommitLineData
a1b77842 1#!/usr/bin/env python3
2
3# Allow execution from anywhere
4import os
5import sys
6
7sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8
9import warnings
10
11from py2exe import freeze
12
13from devscripts.utils import read_version
14
15VERSION = read_version()
16
17
18def 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',
db50f19d 45 # requests >=2.32.0 breaks py2exe builds due to certifi dependency
46 'requests',
add96eb9 47 'urllib3',
a1b77842 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
58if __name__ == '__main__':
59 main()