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
16 with open(fname
, encoding
='utf-8') as f
:
20 # Get the version from yt_dlp/version.py without importing the package
21 def read_version(fname
):
22 exec(compile(read(fname
), fname
, 'exec'))
23 return locals()['__version__']
26 VERSION
= read_version('yt_dlp/version.py')
28 DESCRIPTION
= 'A youtube-dl fork with additional features and patches'
30 LONG_DESCRIPTION
= '\n\n'.join((
31 'Official repository: <https://github.com/yt-dlp/yt-dlp>',
32 '**PS**: Some links in this document will not work since this is a copy of the README.md from Github',
35 REQUIREMENTS
= read('requirements.txt').splitlines()
38 if sys
.argv
[1:2] == ['py2exe']:
39 import py2exe
# noqa: F401
41 'py2exe builds do not support pycryptodomex and needs VC++14 to run. '
42 'The recommended way is to use "pyinst.py" to build using pyinstaller')
45 'script': './yt_dlp/__main__.py',
46 'dest_base': 'yt-dlp',
48 'description': DESCRIPTION
,
49 'comments': LONG_DESCRIPTION
.split('\n')[0],
50 'product_name': 'yt-dlp',
51 'product_version': VERSION
,
59 'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto
60 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
61 # Modules that are only imported dynamically must be added here
62 'includes': ['yt_dlp.compat._legacy'],
70 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
71 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
72 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
73 ('share/doc/yt_dlp', ['README.txt']),
74 ('share/man/man1', ['yt-dlp.1'])
76 root
= os
.path
.dirname(os
.path
.abspath(__file__
))
78 for dirname
, files
in files_spec
:
81 if not os
.path
.exists(fn
):
82 warnings
.warn('Skipping file %s since it is not present. Try running `make pypi-files` first' % fn
)
85 data_files
.append((dirname
, resfiles
))
88 'data_files': data_files
,
91 if setuptools_available
:
92 params
['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
94 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
):
108 spawn([sys
.executable
, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'],
109 dry_run
=self
.dry_run
)
112 if setuptools_available
:
113 packages
= find_packages(exclude
=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins'))
115 packages
= ['yt_dlp', 'yt_dlp.downloader', 'yt_dlp.extractor', 'yt_dlp.postprocessor']
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
,
130 'Documentation': 'https://github.com/yt-dlp/yt-dlp#readme',
131 'Source': 'https://github.com/yt-dlp/yt-dlp',
132 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
133 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators',
136 'Topic :: Multimedia :: Video',
137 'Development Status :: 5 - Production/Stable',
138 'Environment :: Console',
139 'Programming Language :: Python',
140 'Programming Language :: Python :: 3.6',
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 python_requires
='>=3.6',
154 cmdclass
={'build_lazy_extractors': build_lazy_extractors}
,