3 # Allow execution from anywhere
7 sys
.path
.insert(0, os
.path
.dirname(os
.path
.abspath(__file__
)))
12 from setuptools
import Command
, find_packages
, setup
13 setuptools_available
= True
15 from distutils
.core
import Command
, setup
16 setuptools_available
= False
18 from devscripts
.utils
import read_file
, read_version
20 VERSION
= read_version(varname
='_pkg_version')
22 DESCRIPTION
= 'A youtube-dl fork with additional features and patches'
24 LONG_DESCRIPTION
= '\n\n'.join((
25 'Official repository: <https://github.com/yt-dlp/yt-dlp>',
26 '**PS**: Some links in this document will not work since this is a copy of the README.md from Github',
27 read_file('README.md')))
29 REQUIREMENTS
= read_file('requirements.txt').splitlines()
33 if setuptools_available
:
34 return find_packages(exclude
=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins', 'devscripts'))
37 'yt_dlp', 'yt_dlp.extractor', 'yt_dlp.downloader', 'yt_dlp.postprocessor', 'yt_dlp.compat',
43 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
44 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
45 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
46 ('share/doc/yt_dlp', ['README.txt']),
47 ('share/man/man1', ['yt-dlp.1'])
50 for dirname
, files
in files_spec
:
53 if not os
.path
.exists(fn
):
54 warnings
.warn(f
'Skipping file {fn} since it is not present. Try running " make pypi-files " first')
57 data_files
.append((dirname
, resfiles
))
59 params
= {'data_files': data_files
}
61 if setuptools_available
:
62 params
['entry_points'] = {
63 'console_scripts': ['yt-dlp = yt_dlp:main'],
64 'pyinstaller40': ['hook-dirs = yt_dlp.__pyinstaller:get_hook_dirs'],
67 params
['scripts'] = ['yt-dlp']
71 class build_lazy_extractors(Command
):
72 description
= 'Build the extractor lazy loading module'
75 def initialize_options(self
):
78 def finalize_options(self
):
83 print('Skipping build of lazy extractors in dry run mode')
85 subprocess
.run([sys
.executable
, 'devscripts/make_lazy_extractors.py'])
89 params
= build_params()
91 name
='yt-dlp', # package name (do not change/remove comment)
93 maintainer
='pukkandan',
94 maintainer_email
='pukkandan.ytdlp@gmail.com',
95 description
=DESCRIPTION
,
96 long_description
=LONG_DESCRIPTION
,
97 long_description_content_type
='text/markdown',
98 url
='https://github.com/yt-dlp/yt-dlp',
100 install_requires
=REQUIREMENTS
,
101 python_requires
='>=3.8',
103 'Documentation': 'https://github.com/yt-dlp/yt-dlp#readme',
104 'Source': 'https://github.com/yt-dlp/yt-dlp',
105 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
106 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators',
109 'Topic :: Multimedia :: Video',
110 'Development Status :: 5 - Production/Stable',
111 'Environment :: Console',
112 'Programming Language :: Python',
113 'Programming Language :: Python :: 3.8',
114 'Programming Language :: Python :: 3.9',
115 'Programming Language :: Python :: 3.10',
116 'Programming Language :: Python :: 3.11',
117 'Programming Language :: Python :: 3.12',
118 'Programming Language :: Python :: Implementation',
119 'Programming Language :: Python :: Implementation :: CPython',
120 'Programming Language :: Python :: Implementation :: PyPy',
121 'License :: Public Domain',
122 'Operating System :: OS Independent',
124 cmdclass
={'build_lazy_extractors': build_lazy_extractors
},