7 from setuptools
import Command
, find_packages
, setup
8 setuptools_available
= True
10 from distutils
.core
import Command
, setup
11 setuptools_available
= False
12 from distutils
.spawn
import spawn
14 # Get the version from yt_dlp/version.py without importing the package
15 exec(compile(open('yt_dlp/version.py').read(), 'yt_dlp/version.py', 'exec'))
18 DESCRIPTION
= 'A youtube-dl fork with additional features and patches'
20 LONG_DESCRIPTION
= '\n\n'.join((
21 'Official repository: <https://github.com/yt-dlp/yt-dlp>',
22 '**PS**: Some links in this document will not work since this is a copy of the README.md from Github',
23 open('README.md', encoding
='utf-8').read()))
25 REQUIREMENTS
= open('requirements.txt', encoding
='utf-8').read().splitlines()
28 if sys
.argv
[1:2] == ['py2exe']:
31 'py2exe builds do not support pycryptodomex and needs VC++14 to run. '
32 'The recommended way is to use "pyinst.py" to build using pyinstaller')
35 'script': './yt_dlp/__main__.py',
36 'dest_base': 'yt-dlp',
37 'version': __version__
,
38 'description': DESCRIPTION
,
39 'comments': LONG_DESCRIPTION
.split('\n')[0],
40 'product_name': 'yt-dlp',
41 'product_version': __version__
,
49 'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto
50 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
58 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
59 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
60 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
61 ('share/doc/yt_dlp', ['README.txt']),
62 ('share/man/man1', ['yt-dlp.1'])
64 root
= os
.path
.dirname(os
.path
.abspath(__file__
))
66 for dirname
, files
in files_spec
:
69 if not os
.path
.exists(fn
):
70 warnings
.warn('Skipping file %s since it is not present. Try running `make pypi-files` first' % fn
)
73 data_files
.append((dirname
, resfiles
))
76 'data_files': data_files
,
79 if setuptools_available
:
80 params
['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
82 params
['scripts'] = ['yt-dlp']
85 class build_lazy_extractors(Command
):
86 description
= 'Build the extractor lazy loading module'
89 def initialize_options(self
):
92 def finalize_options(self
):
96 spawn([sys
.executable
, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'],
100 if setuptools_available
:
101 packages
= find_packages(exclude
=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins'))
103 packages
= ['yt_dlp', 'yt_dlp.downloader', 'yt_dlp.extractor', 'yt_dlp.postprocessor']
109 maintainer
='pukkandan',
110 maintainer_email
='pukkandan.ytdlp@gmail.com',
111 description
=DESCRIPTION
,
112 long_description
=LONG_DESCRIPTION
,
113 long_description_content_type
='text/markdown',
114 url
='https://github.com/yt-dlp/yt-dlp',
116 install_requires
=REQUIREMENTS
,
118 'Documentation': 'https://yt-dlp.readthedocs.io',
119 'Source': 'https://github.com/yt-dlp/yt-dlp',
120 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
121 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators',
124 'Topic :: Multimedia :: Video',
125 'Development Status :: 5 - Production/Stable',
126 'Environment :: Console',
127 'Programming Language :: Python',
128 'Programming Language :: Python :: 3.6',
129 'Programming Language :: Python :: 3.7',
130 'Programming Language :: Python :: 3.8',
131 'Programming Language :: Python :: Implementation',
132 'Programming Language :: Python :: Implementation :: CPython',
133 'Programming Language :: Python :: Implementation :: PyPy',
134 'License :: Public Domain',
135 'Operating System :: OS Independent',
137 python_requires
='>=3.6',
139 cmdclass
={'build_lazy_extractors': build_lazy_extractors}
,