8 from setuptools
import setup
, Command
, find_packages
9 setuptools_available
= True
11 from distutils
.core
import setup
, Command
12 setuptools_available
= False
13 from distutils
.spawn
import spawn
15 # Get the version from yt_dlp/version.py without importing the package
16 exec(compile(open('yt_dlp/version.py').read(), 'yt_dlp/version.py', 'exec'))
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 open('README.md', 'r', encoding
='utf-8').read()))
26 REQUIREMENTS
= ['mutagen', 'pycryptodomex', 'websockets']
29 if sys
.argv
[1:2] == ['py2exe']:
32 'py2exe builds do not support pycryptodomex and needs VC++14 to run. '
33 'The recommended way is to use "pyinst.py" to build using pyinstaller')
36 'script': './yt_dlp/__main__.py',
37 'dest_base': 'yt-dlp',
38 'version': __version__
,
39 'description': DESCRIPTION
,
40 'comments': LONG_DESCRIPTION
.split('\n')[0],
41 'product_name': 'yt-dlp',
42 'product_version': __version__
,
50 'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto
51 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
59 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
60 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
61 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
62 ('share/doc/yt_dlp', ['README.txt']),
63 ('share/man/man1', ['yt-dlp.1'])
65 root
= os
.path
.dirname(os
.path
.abspath(__file__
))
67 for dirname
, files
in files_spec
:
70 if not os
.path
.exists(fn
):
71 warnings
.warn('Skipping file %s since it is not present. Try running `make pypi-files` first' % fn
)
74 data_files
.append((dirname
, resfiles
))
77 'data_files': data_files
,
80 if setuptools_available
:
81 params
['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
83 params
['scripts'] = ['yt-dlp']
86 class build_lazy_extractors(Command
):
87 description
= 'Build the extractor lazy loading module'
90 def initialize_options(self
):
93 def finalize_options(self
):
97 spawn([sys
.executable
, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'],
101 if setuptools_available
:
102 packages
= find_packages(exclude
=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins'))
104 packages
= ['yt_dlp', 'yt_dlp.downloader', 'yt_dlp.extractor', 'yt_dlp.postprocessor']
110 maintainer
='pukkandan',
111 maintainer_email
='pukkandan.ytdlp@gmail.com',
112 description
=DESCRIPTION
,
113 long_description
=LONG_DESCRIPTION
,
114 long_description_content_type
='text/markdown',
115 url
='https://github.com/yt-dlp/yt-dlp',
117 install_requires
=REQUIREMENTS
,
119 'Documentation': 'https://yt-dlp.readthedocs.io',
120 'Source': 'https://github.com/yt-dlp/yt-dlp',
121 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
122 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators',
125 'Topic :: Multimedia :: Video',
126 'Development Status :: 5 - Production/Stable',
127 'Environment :: Console',
128 'Programming Language :: Python',
129 'Programming Language :: Python :: 3.6',
130 'Programming Language :: Python :: 3.7',
131 'Programming Language :: Python :: 3.8',
132 'Programming Language :: Python :: Implementation',
133 'Programming Language :: Python :: Implementation :: CPython',
134 'Programming Language :: Python :: Implementation :: PyPy',
135 'License :: Public Domain',
136 'Operating System :: OS Independent',
138 python_requires
='>=3.6',
140 cmdclass
={'build_lazy_extractors': build_lazy_extractors}
,