9 from setuptools
import Command
, find_packages
, setup
10 setuptools_available
= True
12 from distutils
.core
import Command
, setup
13 setuptools_available
= False
15 from devscripts
.utils
import read_file
, read_version
17 VERSION
= read_version()
19 DESCRIPTION
= 'A youtube-dl fork with additional features and patches'
21 LONG_DESCRIPTION
= '\n\n'.join((
22 'Official repository: <https://github.com/yt-dlp/yt-dlp>',
23 '**PS**: Some links in this document will not work since this is a copy of the README.md from Github',
24 read_file('README.md')))
26 REQUIREMENTS
= read_file('requirements.txt').splitlines()
30 if setuptools_available
:
31 return find_packages(exclude
=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins', 'devscripts'))
34 'yt_dlp', 'yt_dlp.extractor', 'yt_dlp.downloader', 'yt_dlp.postprocessor', 'yt_dlp.compat',
40 'py2exe builds do not support pycryptodomex and needs VC++14 to run. '
41 'It is recommended to run "pyinst.py" to build using pyinstaller instead')
45 'script': './yt_dlp/__main__.py',
46 'dest_base': 'yt-dlp',
47 'icon_resources': [(1, 'devscripts/logo.ico')],
51 'description': DESCRIPTION
,
52 'comments': LONG_DESCRIPTION
.split('\n')[0],
53 'product_name': 'yt-dlp',
54 'product_version': VERSION
,
61 'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto
62 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
63 # Modules that are only imported dynamically must be added here
64 'includes': ['yt_dlp.compat._legacy'],
72 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
73 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
74 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
75 ('share/doc/yt_dlp', ['README.txt']),
76 ('share/man/man1', ['yt-dlp.1'])
79 for dirname
, files
in files_spec
:
82 if not os
.path
.exists(fn
):
83 warnings
.warn(f
'Skipping file {fn} since it is not present. Try running " make pypi-files " first')
86 data_files
.append((dirname
, resfiles
))
88 params
= {'data_files': data_files
}
90 if setuptools_available
:
91 params
['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
93 params
['scripts'] = ['yt-dlp']
97 class build_lazy_extractors(Command
):
98 description
= 'Build the extractor lazy loading module'
101 def initialize_options(self
):
104 def finalize_options(self
):
109 print('Skipping build of lazy extractors in dry run mode')
111 subprocess
.run([sys
.executable
, 'devscripts/make_lazy_extractors.py'])
115 if sys
.argv
[1:2] == ['py2exe']:
116 params
= py2exe_params()
118 from py2exe
import freeze
120 import py2exe
# noqa: F401
121 warnings
.warn('You are using an outdated version of py2exe. Support for this version will be removed in the future')
122 params
['console'][0].update(params
.pop('version_info'))
123 params
['options'] = {'py2exe': params
.pop('options')}
125 return freeze(**params
)
127 params
= build_params()
132 maintainer
='pukkandan',
133 maintainer_email
='pukkandan.ytdlp@gmail.com',
134 description
=DESCRIPTION
,
135 long_description
=LONG_DESCRIPTION
,
136 long_description_content_type
='text/markdown',
137 url
='https://github.com/yt-dlp/yt-dlp',
139 install_requires
=REQUIREMENTS
,
140 python_requires
='>=3.7',
142 'Documentation': 'https://github.com/yt-dlp/yt-dlp#readme',
143 'Source': 'https://github.com/yt-dlp/yt-dlp',
144 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
145 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators',
148 'Topic :: Multimedia :: Video',
149 'Development Status :: 5 - Production/Stable',
150 'Environment :: Console',
151 'Programming Language :: Python',
152 'Programming Language :: Python :: 3.7',
153 'Programming Language :: Python :: 3.8',
154 'Programming Language :: Python :: 3.9',
155 'Programming Language :: Python :: 3.10',
156 'Programming Language :: Python :: 3.11',
157 'Programming Language :: Python :: Implementation',
158 'Programming Language :: Python :: Implementation :: CPython',
159 'Programming Language :: Python :: Implementation :: PyPy',
160 'License :: Public Domain',
161 'Operating System :: OS Independent',
163 cmdclass
={'build_lazy_extractors': build_lazy_extractors
},