4 from __future__ import print_function
11 from setuptools import setup, Command
12 setuptools_available = True
14 from distutils.core import setup, Command
15 setuptools_available = False
16 from distutils.spawn import spawn
19 # This will create an exe that needs Microsoft Visual C++ 2008
20 # Redistributable Package
23 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
24 print('Cannot import py2exe', file=sys.stderr)
32 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
35 # Get the version from youtube_dl/version.py without importing the package
36 exec(compile(open('youtube_dl/version.py').read(),
37 'youtube_dl/version.py', 'exec'))
39 DESCRIPTION = 'YouTube video downloader'
40 LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites'
43 'script': './youtube_dl/__main__.py',
44 'dest_base': 'youtube-dl',
45 'version': __version__,
46 'description': DESCRIPTION,
47 'comments': LONG_DESCRIPTION,
48 'product_name': 'youtube-dl',
49 'product_version': __version__,
53 'console': py2exe_console,
54 'options': {'py2exe': py2exe_options},
58 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
59 params = py2exe_params
62 ('etc/bash_completion.d', ['youtube-dl.bash-completion']),
63 ('etc/fish/completions', ['youtube-dl.fish']),
64 ('share/doc/youtube_dl', ['README.txt']),
65 ('share/man/man1', ['youtube-dl.1'])
67 root = os.path.dirname(os.path.abspath(__file__))
69 for dirname, files in files_spec:
72 if not os.path.exists(fn):
73 warnings.warn('Skipping file %s since it is not present. Type make to build all automatically generated files.' % fn)
76 data_files.append((dirname, resfiles))
79 'data_files': data_files,
81 if setuptools_available:
82 params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']}
84 params['scripts'] = ['bin/youtube-dl']
86 class build_lazy_extractors(Command):
87 description = 'Build the extractor lazy loading module'
90 def initialize_options(self):
93 def finalize_options(self):
98 [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'],
105 description=DESCRIPTION,
106 long_description=LONG_DESCRIPTION,
107 url='https://github.com/rg3/youtube-dl',
108 author='Ricardo Garcia',
109 author_email='ytdl@yt-dl.org',
110 maintainer='Philipp Hagemeister',
111 maintainer_email='phihag@phihag.de',
114 'youtube_dl.extractor', 'youtube_dl.downloader',
115 'youtube_dl.postprocessor'],
117 # Provokes warning on most systems (why?!)
118 # test_suite = 'nose.collector',
119 # test_requires = ['nosetest'],
122 'Topic :: Multimedia :: Video',
123 'Development Status :: 5 - Production/Stable',
124 'Environment :: Console',
125 'License :: Public Domain',
126 'Programming Language :: Python :: 2.6',
127 'Programming Language :: Python :: 2.7',
128 'Programming Language :: Python :: 3',
129 'Programming Language :: Python :: 3.2',
130 'Programming Language :: Python :: 3.3',
131 'Programming Language :: Python :: 3.4',
132 'Programming Language :: Python :: 3.5',
135 cmdclass={'build_lazy_extractors': build_lazy_extractors},