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',
35 'yt_dlp.extractor.anvato_token_generator',
40 import py2exe
# noqa: F401
43 'py2exe builds do not support pycryptodomex and needs VC++14 to run. '
44 'The recommended way is to use "pyinst.py" to build using pyinstaller')
48 'script': './yt_dlp/__main__.py',
49 'dest_base': 'yt-dlp',
51 'description': DESCRIPTION
,
52 'comments': LONG_DESCRIPTION
.split('\n')[0],
53 'product_name': 'yt-dlp',
54 'product_version': VERSION
,
55 'icon_resources': [(1, 'devscripts/logo.ico')],
63 'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto
64 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
65 # Modules that are only imported dynamically must be added here
66 'includes': ['yt_dlp.compat._legacy'],
75 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
76 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
77 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
78 ('share/doc/yt_dlp', ['README.txt']),
79 ('share/man/man1', ['yt-dlp.1'])
82 for dirname
, files
in files_spec
:
85 if not os
.path
.exists(fn
):
86 warnings
.warn(f
'Skipping file {fn} since it is not present. Try running " make pypi-files " first')
89 data_files
.append((dirname
, resfiles
))
91 params
= {'data_files': data_files
}
93 if setuptools_available
:
94 params
['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
96 params
['scripts'] = ['yt-dlp']
100 class build_lazy_extractors(Command
):
101 description
= 'Build the extractor lazy loading module'
104 def initialize_options(self
):
107 def finalize_options(self
):
112 print('Skipping build of lazy extractors in dry run mode')
114 subprocess
.run([sys
.executable
, 'devscripts/make_lazy_extractors.py'])
117 params
= py2exe_params() if sys
.argv
[1:2] == ['py2exe'] else build_params()
121 maintainer
='pukkandan',
122 maintainer_email
='pukkandan.ytdlp@gmail.com',
123 description
=DESCRIPTION
,
124 long_description
=LONG_DESCRIPTION
,
125 long_description_content_type
='text/markdown',
126 url
='https://github.com/yt-dlp/yt-dlp',
128 install_requires
=REQUIREMENTS
,
129 python_requires
='>=3.7',
131 'Documentation': 'https://github.com/yt-dlp/yt-dlp#readme',
132 'Source': 'https://github.com/yt-dlp/yt-dlp',
133 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
134 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators',
137 'Topic :: Multimedia :: Video',
138 'Development Status :: 5 - Production/Stable',
139 'Environment :: Console',
140 'Programming Language :: Python',
141 'Programming Language :: Python :: 3.7',
142 'Programming Language :: Python :: 3.8',
143 'Programming Language :: Python :: 3.9',
144 'Programming Language :: Python :: 3.10',
145 'Programming Language :: Python :: 3.11',
146 'Programming Language :: Python :: Implementation',
147 'Programming Language :: Python :: Implementation :: CPython',
148 'Programming Language :: Python :: Implementation :: PyPy',
149 'License :: Public Domain',
150 'Operating System :: OS Independent',
152 cmdclass
={'build_lazy_extractors': build_lazy_extractors
},