2012-07-01 02:48:52 +02:00
|
|
|
#!/usr/bin/env python
|
2018-05-29 01:15:37 +02:00
|
|
|
import codecs
|
2021-10-09 18:58:56 +02:00
|
|
|
import sys
|
2019-03-07 02:34:16 +01:00
|
|
|
from os import environ, path
|
|
|
|
from sys import argv, path as sys_path
|
2018-06-08 03:01:16 +02:00
|
|
|
|
2020-10-26 14:46:17 +01:00
|
|
|
from setuptools import find_packages, setup
|
2011-08-15 04:37:22 +02:00
|
|
|
|
2018-06-08 03:01:16 +02:00
|
|
|
import versioneer
|
2012-04-19 21:45:06 +02:00
|
|
|
|
2020-10-07 07:25:36 +02:00
|
|
|
|
2021-10-09 18:58:56 +02:00
|
|
|
CURRENT_PYTHON = sys.version_info[:2]
|
|
|
|
REQUIRED_PYTHON = (3, 6)
|
|
|
|
|
|
|
|
# This check and everything above must remain compatible with older Python versions
|
|
|
|
if CURRENT_PYTHON < REQUIRED_PYTHON:
|
|
|
|
# noinspection PyStringFormat
|
|
|
|
sys.exit(
|
|
|
|
"""
|
|
|
|
========================================================
|
|
|
|
Unsupported Python version
|
|
|
|
========================================================
|
|
|
|
This version of Streamlink requires at least Python {}.{},
|
|
|
|
but you're trying to install it on Python {}.{}.
|
|
|
|
|
|
|
|
This may be because you are using a version of pip that
|
|
|
|
doesn't understand the python_requires classifier.
|
|
|
|
Make sure you have pip >= 9.0 and setuptools >= 24.2
|
|
|
|
"""
|
|
|
|
.strip(" \n")
|
|
|
|
.format(*(REQUIRED_PYTHON + CURRENT_PYTHON))
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-12-28 12:35:51 +01:00
|
|
|
data_files = []
|
2018-06-08 03:01:16 +02:00
|
|
|
deps = [
|
2021-08-22 10:46:15 +02:00
|
|
|
"requests>=2.26.0,<3.0",
|
2018-06-08 03:01:16 +02:00
|
|
|
"isodate",
|
2021-08-28 03:02:37 +02:00
|
|
|
"lxml>=4.6.3",
|
2021-03-20 09:49:48 +01:00
|
|
|
"websocket-client>=0.58.0",
|
2018-06-08 03:01:16 +02:00
|
|
|
# Support for SOCKS proxies
|
|
|
|
"PySocks!=1.5.7,>=1.5.6",
|
|
|
|
]
|
2013-11-15 20:22:57 +01:00
|
|
|
|
2017-03-17 20:37:18 +01:00
|
|
|
# for encrypted streams
|
|
|
|
if environ.get("STREAMLINK_USE_PYCRYPTO"):
|
|
|
|
deps.append("pycrypto")
|
|
|
|
else:
|
|
|
|
# this version of pycryptodome is known to work and has a Windows wheel for py2.7, py3.3-3.6
|
|
|
|
deps.append("pycryptodome>=3.4.3,<4")
|
2017-01-05 10:25:30 +01:00
|
|
|
|
2017-01-20 14:02:14 +01:00
|
|
|
# for localization
|
2017-02-15 13:43:29 +01:00
|
|
|
if environ.get("STREAMLINK_USE_PYCOUNTRY"):
|
|
|
|
deps.append("pycountry")
|
|
|
|
else:
|
|
|
|
deps.append("iso-639")
|
|
|
|
deps.append("iso3166")
|
2017-01-20 14:02:14 +01:00
|
|
|
|
2018-05-29 01:15:37 +02:00
|
|
|
# When we build an egg for the Win32 bootstrap we don"t want dependency
|
2014-06-11 19:34:43 +02:00
|
|
|
# information built into it.
|
|
|
|
if environ.get("NO_DEPS"):
|
|
|
|
deps = []
|
2013-02-08 02:00:44 +01:00
|
|
|
|
2018-05-29 01:15:37 +02:00
|
|
|
this_directory = path.abspath(path.dirname(__file__))
|
|
|
|
srcdir = path.join(this_directory, "src/")
|
2013-02-08 02:00:44 +01:00
|
|
|
sys_path.insert(0, srcdir)
|
|
|
|
|
2018-05-29 01:15:37 +02:00
|
|
|
with codecs.open(path.join(this_directory, "README.md"), 'r', "utf8") as f:
|
|
|
|
long_description = f.read()
|
|
|
|
|
2019-03-07 02:34:16 +01:00
|
|
|
|
|
|
|
def is_wheel_for_windows():
|
|
|
|
if "bdist_wheel" in argv:
|
|
|
|
names = ["win32", "win-amd64", "cygwin"]
|
|
|
|
length = len(argv)
|
|
|
|
for pos in range(argv.index("bdist_wheel") + 1, length):
|
|
|
|
if argv[pos] == "--plat-name" and pos + 1 < length:
|
|
|
|
return argv[pos + 1] in names
|
|
|
|
elif argv[pos][:12] == "--plat-name=":
|
|
|
|
return argv[pos][12:] in names
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
entry_points = {
|
|
|
|
"console_scripts": ["streamlink=streamlink_cli.main:main"]
|
|
|
|
}
|
|
|
|
|
|
|
|
if is_wheel_for_windows():
|
|
|
|
entry_points["gui_scripts"] = ["streamlinkw=streamlink_cli.main:main"]
|
|
|
|
|
|
|
|
|
2021-09-25 12:35:43 +02:00
|
|
|
# optional data files
|
2020-12-28 12:35:51 +01:00
|
|
|
additional_files = [
|
2021-09-25 12:35:43 +02:00
|
|
|
# shell completions
|
|
|
|
# requires pre-built completion files via shtab (dev-requirements.txt)
|
|
|
|
# `./script/build-shell-completions.sh`
|
|
|
|
("share/bash-completion/completions", ["build/shtab/bash/streamlink"]),
|
|
|
|
("share/zsh/site-functions", ["build/shtab/zsh/_streamlink"]),
|
|
|
|
# man page
|
|
|
|
# requires pre-built man page file via sphinx (docs-requirements.txt)
|
|
|
|
# `make --directory=docs clean man`
|
2020-12-28 12:35:51 +01:00
|
|
|
("share/man/man1", ["docs/_build/man/streamlink.1"])
|
|
|
|
]
|
|
|
|
|
|
|
|
for destdir, srcfiles in additional_files:
|
|
|
|
files = []
|
|
|
|
for srcfile in srcfiles:
|
|
|
|
if path.exists(srcfile):
|
|
|
|
files.append(srcfile)
|
|
|
|
if files:
|
|
|
|
data_files.append((destdir, files))
|
|
|
|
|
|
|
|
|
2016-09-19 21:46:06 +02:00
|
|
|
setup(name="streamlink",
|
2018-05-14 07:18:52 +02:00
|
|
|
version=versioneer.get_version(),
|
|
|
|
cmdclass=versioneer.get_cmdclass(),
|
2020-10-07 07:25:36 +02:00
|
|
|
description="Streamlink is a command-line utility that extracts streams "
|
2014-06-16 21:44:47 +02:00
|
|
|
"from various services and pipes them into a video player of "
|
2013-08-08 15:01:32 +02:00
|
|
|
"choice.",
|
2018-05-29 01:15:37 +02:00
|
|
|
long_description=long_description,
|
|
|
|
long_description_content_type="text/markdown",
|
2016-09-21 22:59:05 +02:00
|
|
|
url="https://github.com/streamlink/streamlink",
|
2018-05-29 01:15:37 +02:00
|
|
|
project_urls={
|
|
|
|
"Documentation": "https://streamlink.github.io/",
|
|
|
|
"Tracker": "https://github.com/streamlink/streamlink/issues",
|
|
|
|
"Source": "https://github.com/streamlink/streamlink",
|
|
|
|
"Funding": "https://opencollective.com/streamlink"
|
|
|
|
},
|
2016-09-21 22:59:05 +02:00
|
|
|
author="Streamlink",
|
2018-06-08 03:01:16 +02:00
|
|
|
# temp until we have a mailing list / global email
|
2020-12-05 21:26:47 +01:00
|
|
|
author_email="streamlink@protonmail.com",
|
2013-02-08 02:00:44 +01:00
|
|
|
license="Simplified BSD",
|
2017-01-05 10:25:30 +01:00
|
|
|
packages=find_packages("src"),
|
2016-09-21 22:59:05 +02:00
|
|
|
package_dir={"": "src"},
|
2021-03-26 22:58:52 +01:00
|
|
|
package_data={"streamlink.plugins": [".removed"]},
|
2019-03-07 02:34:16 +01:00
|
|
|
entry_points=entry_points,
|
2020-12-28 12:35:51 +01:00
|
|
|
data_files=data_files,
|
2012-07-01 02:48:52 +02:00
|
|
|
install_requires=deps,
|
2012-11-19 03:47:13 +01:00
|
|
|
test_suite="tests",
|
2020-10-19 17:26:45 +02:00
|
|
|
python_requires=">=3.6, <4",
|
2014-06-27 16:02:26 +02:00
|
|
|
classifiers=["Development Status :: 5 - Production/Stable",
|
2018-05-29 01:15:37 +02:00
|
|
|
"License :: OSI Approved :: BSD License",
|
2012-07-01 02:48:52 +02:00
|
|
|
"Environment :: Console",
|
2018-05-29 01:15:37 +02:00
|
|
|
"Intended Audience :: End Users/Desktop",
|
2014-06-27 16:02:26 +02:00
|
|
|
"Operating System :: POSIX",
|
|
|
|
"Operating System :: Microsoft :: Windows",
|
2018-05-29 01:15:37 +02:00
|
|
|
"Operating System :: MacOS",
|
2020-10-07 07:25:36 +02:00
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"Programming Language :: Python :: 3 :: Only",
|
2018-05-29 01:15:37 +02:00
|
|
|
"Programming Language :: Python :: 3.6",
|
|
|
|
"Programming Language :: Python :: 3.7",
|
2019-12-14 11:18:29 +01:00
|
|
|
"Programming Language :: Python :: 3.8",
|
2020-10-07 07:25:36 +02:00
|
|
|
"Programming Language :: Python :: 3.9",
|
2012-07-01 02:48:52 +02:00
|
|
|
"Topic :: Internet :: WWW/HTTP",
|
|
|
|
"Topic :: Multimedia :: Sound/Audio",
|
2012-12-19 20:52:53 +01:00
|
|
|
"Topic :: Multimedia :: Video",
|
2016-09-21 22:59:05 +02:00
|
|
|
"Topic :: Utilities"])
|