]>
Commit | Line | Data |
---|---|---|
cc52de43 | 1 | #!/usr/bin/env python3 |
dcdb292f | 2 | # coding: utf-8 |
2f1765c4 | 3 | |
58ac65e7 | 4 | from setuptools import setup, Command, find_packages |
6c57e8a0 | 5 | import os.path |
6c57e8a0 | 6 | import warnings |
4efe62a0 | 7 | import sys |
5a9858bf | 8 | from distutils.spawn import spawn |
a32b573c | 9 | |
e38df8f9 | 10 | |
7a5c1cfe | 11 | # Get the version from yt_dlp/version.py without importing the package |
cc1dfc93 | 12 | exec(compile(open('yt_dlp/version.py').read(), 'yt_dlp/version.py', 'exec')) |
3d4b08df | 13 | |
e38df8f9 | 14 | |
7bc877a2 | 15 | DESCRIPTION = 'Command-line program to download videos from YouTube.com and many other other video platforms.' |
16 | ||
17 | LONG_DESCRIPTION = '\n\n'.join(( | |
7a5c1cfe | 18 | 'Official repository: <https://github.com/yt-dlp/yt-dlp>', |
cc1dfc93 | 19 | '**PS**: Some links in this document will not work since this is a copy of the README.md from Github', |
e28f1c0a | 20 | open('README.md', 'r', encoding='utf-8').read())) |
770234af | 21 | |
e36d50c5 | 22 | REQUIREMENTS = ['mutagen', 'pycryptodome', 'websockets'] |
e38df8f9 | 23 | |
cc1dfc93 | 24 | if sys.argv[1:2] == ['py2exe']: |
25 | raise NotImplementedError('py2exe is not currently supported; instead, use "pyinst.py" to build with pyinstaller') | |
26 | ||
27 | ||
28 | files_spec = [ | |
29 | ('share/bash-completion/completions', ['completions/bash/yt-dlp']), | |
30 | ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']), | |
31 | ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']), | |
32 | ('share/doc/yt_dlp', ['README.txt']), | |
33 | ('share/man/man1', ['yt-dlp.1']) | |
34 | ] | |
35 | root = os.path.dirname(os.path.abspath(__file__)) | |
36 | data_files = [] | |
37 | for dirname, files in files_spec: | |
38 | resfiles = [] | |
39 | for fn in files: | |
40 | if not os.path.exists(fn): | |
41 | warnings.warn('Skipping file %s since it is not present. Try running `make pypi-files` first' % fn) | |
42 | else: | |
43 | resfiles.append(fn) | |
44 | data_files.append((dirname, resfiles)) | |
45 | ||
46 | params = { | |
47 | 'data_files': data_files, | |
48 | } | |
49 | params['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']} | |
66c935fb | 50 | |
a5741a3f | 51 | |
5a9858bf | 52 | class build_lazy_extractors(Command): |
3d4b08df | 53 | description = 'Build the extractor lazy loading module' |
5a9858bf JMF |
54 | user_options = [] |
55 | ||
56 | def initialize_options(self): | |
57 | pass | |
58 | ||
59 | def finalize_options(self): | |
60 | pass | |
61 | ||
62 | def run(self): | |
cc1dfc93 | 63 | spawn([sys.executable, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'], |
64 | dry_run=self.dry_run) | |
5a9858bf | 65 | |
66c935fb | 66 | |
e28f1c0a | 67 | packages = find_packages(exclude=('youtube_dl', 'test', 'ytdlp_plugins')) |
66c935fb | 68 | |
cc51a7d4 | 69 | setup( |
e28f1c0a | 70 | name='yt-dlp', |
652e7768 | 71 | version=__version__, |
e28f1c0a | 72 | maintainer='pukkandan', |
73 | maintainer_email='pukkandan.ytdlp@gmail.com', | |
3d4b08df S |
74 | description=DESCRIPTION, |
75 | long_description=LONG_DESCRIPTION, | |
e28f1c0a | 76 | long_description_content_type='text/markdown', |
77 | url='https://github.com/yt-dlp/yt-dlp', | |
66c935fb | 78 | packages=packages, |
e38df8f9 | 79 | install_requires=REQUIREMENTS, |
7bc877a2 | 80 | project_urls={ |
0744a815 | 81 | 'Documentation': 'https://yt-dlp.readthedocs.io', |
7a5c1cfe P |
82 | 'Source': 'https://github.com/yt-dlp/yt-dlp', |
83 | 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues', | |
7bc877a2 | 84 | #'Funding': 'https://donate.pypi.org', |
85 | }, | |
652e7768 | 86 | classifiers=[ |
e28f1c0a | 87 | 'Topic :: Multimedia :: Video', |
88 | 'Development Status :: 5 - Production/Stable', | |
89 | 'Environment :: Console', | |
90 | 'Programming Language :: Python', | |
e28f1c0a | 91 | 'Programming Language :: Python :: 3.6', |
92 | 'Programming Language :: Python :: 3.7', | |
93 | 'Programming Language :: Python :: 3.8', | |
94 | 'Programming Language :: Python :: Implementation', | |
95 | 'Programming Language :: Python :: Implementation :: CPython', | |
e28f1c0a | 96 | 'Programming Language :: Python :: Implementation :: PyPy', |
97 | 'License :: Public Domain', | |
98 | 'Operating System :: OS Independent', | |
a5741a3f | 99 | ], |
14b17a55 | 100 | python_requires='>=3.6', |
359d6d86 | 101 | |
102 | cmdclass={'build_lazy_extractors': build_lazy_extractors}, | |
fec89790 | 103 | **params |
6515018d | 104 | ) |