summaryrefslogtreecommitdiff
path: root/net-misc/streamlink
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-22 17:18:34 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-22 17:18:34 +0000
commitfd87b7c771378b2116981e3924bee5805148e118 (patch)
tree91ed28393c7b534787d3c073e269fe598d0fd535 /net-misc/streamlink
parent77b74be093bdf4a0ed4121acc3f8e229103cf004 (diff)
gentoo auto-resync : 22:11:2023 - 17:18:34
Diffstat (limited to 'net-misc/streamlink')
-rw-r--r--net-misc/streamlink/Manifest5
-rw-r--r--net-misc/streamlink/files/streamlink-6.4.0-libxml2-2.12.0.patch199
-rw-r--r--net-misc/streamlink/streamlink-6.4.0.ebuild78
-rw-r--r--net-misc/streamlink/streamlink-9999.ebuild5
4 files changed, 286 insertions, 1 deletions
diff --git a/net-misc/streamlink/Manifest b/net-misc/streamlink/Manifest
index e84b849cacea..393e05c63f55 100644
--- a/net-misc/streamlink/Manifest
+++ b/net-misc/streamlink/Manifest
@@ -1,14 +1,17 @@
+AUX streamlink-6.4.0-libxml2-2.12.0.patch 7853 BLAKE2B ca0018216e921e6d7a20be200e9d7b6c900f9c8839c7cf05ccc3c2579dbe45767f424a352f89de8299e8deb53034afb89072cd986878b2c550ac24943996e2ae SHA512 c13fc361763da0f00e932250073711cb89acdd3dcc9b15d2c9ae03e177de357afeab02f19c14f6ef73e328bdccf3cd2b7028f31555396309ab63884c1e688033
DIST streamlink-5.5.1.tar.gz 536064 BLAKE2B 0a651c5dcf9fe0a70ee93505ad0a0ea6aaf10739edc763a796633ce34b8235e4aa6a5a45bd1f6dd2591ced9cd87141d4b89d34e9e399d6166d74c9c3ee12f5ea SHA512 2d7fd75bbf356baaf91791930e74e361b37abf0ff1251fa3022ca216dc16a8610635089cb746506baec82c31f8bc569e3b8e538b17ba910389168e61dcdbbe0f
DIST streamlink-6.0.1.tar.gz 682425 BLAKE2B a84c6c1594b78b62c1c20c021c3dde2eae06e86fad559de285800cb5f1cc2d97dadb5724053b320dafdbca3545e1d10171d1adc3b8a1c9c67d2e4d80940357dc SHA512 96081a23b616d85a0918583d951334f35843cb47d6d3d317c3903516b951db2a953db1ea2cb1fb3de95cb059a37dc605d40817e81819acf4e5c98f831bd39323
DIST streamlink-6.1.0.tar.gz 686463 BLAKE2B cc2890db0181e47bcae9da38eddeaadfd34b29a3d4b8bc2bb4d296289cdb356f9614d4e1edd8b11e23d226115f645399296d5589e42832ad473d9cb96ebfde0f SHA512 24fb549be6088eb913348ae892f694b91a6d6c929a06b9ed0db050e203a020ea9780b217f96d7890b7309d304e9a547c47673b8b3f2588dfedbaa44bb5808e29
DIST streamlink-6.2.0.tar.gz 690986 BLAKE2B 5f7cab73ea366580aeb837b8f8a27fa7cd5ca687afa53908900dc9f290a0da916778fda8351acda00f795688b156ca0f37302e67128ce30e9838a45111b88ecd SHA512 2747ebc584caa8ebb2fde5d4f309c911a52fd1a8d2d0e832487e589873c270534e0d0b18120a2db7a68e150e301e57db1e8d63f1d5bb6244f364e9cbd6606213
DIST streamlink-6.2.1.tar.gz 692446 BLAKE2B c1b98ffca37051675a92afc86d12635b538c1b12c023b652a05516faffb289f50b479b38ae48813a4f83d6c881dc7f211e66c6d7f7dd08adcf1a354c9bd15427 SHA512 852610d97138cf0a8066f760f747cb32f1d51c8c55b84df5b6a798556343010c2e68ca5d9a8473e8d32f72bc2a5d89f9d90ee70ccced84b6c9408930ed49585a
DIST streamlink-6.3.1.tar.gz 699073 BLAKE2B 9d1fc58bd0cf4539369fc9d49230c18ef3b9a783783a517c831089571424412841f9e8925202d32bc4218d7a08e4e53c823fc503199131edb59e8fd69e8d49fa SHA512 a1e50688acd3b99efd20c1ff1d3bda03cb6e6b5566484d29372bc6d08ee4115f8ad2edea2f0a90f5de105edb52689781892f413f4af3d836cdd9e9a364006610
+DIST streamlink-6.4.0.tar.gz 715287 BLAKE2B e2657a03bbc02e40207079a43dd2770dddb46b1b07db428bef4623a760bf37dc6853bbbc49a65462f5063e377ca45d2c540e6b879ba7852f76d49062c668f1af SHA512 94387a8d7861c2010319a57b57c430a9600ec3da17320293a13caa5769d19ab366522f36c24d96d481e123faddf6869b1126e3657a1c3b3164a8313daf9a3efb
EBUILD streamlink-5.5.1.ebuild 1544 BLAKE2B 80f5cc0c5b84ee0baf644d3af104d796f104474df6bd1039e87394f3a26732754cad19d6ac10533b2618a97db3c745d1e7fd52e78c25ae321610eab27af51336 SHA512 e21839c90166932d66de3946280397363493a725aa01b796d9b758492cb3dc16ac838aae753de88adc84ec94c24a882780cb72dcdefaed7cded987704b857383
EBUILD streamlink-6.0.1.ebuild 1692 BLAKE2B ed4cbf9845ad507c3b73b28443bf92361d5ace7c0e2f79d343b06ae1629b9c49775746beba2d140ce70eae0b89d585c90cca4d9784aec6facf86eac9f2debb9b SHA512 c982240eac7f913eb7f250d1f30a1152659a5153f8f4f1bc5f886c2b72971a5a9e5b318edd02729ae77b7a287bfc96a0aa4cb17325f11a1dbc9ab43b3a0c70e4
EBUILD streamlink-6.1.0.ebuild 1659 BLAKE2B 5b732dbacc0bd36345fcc68581829d7ec463bf3493a5eb34f5188645cdc0b57f64326bf6010b7dd209009b59ebfb9e377eccffcaef369c875fe14bbc7af5314a SHA512 95ddf3426d727908239d6c5be7e0f2543f8c83d7d77e04e9f89f25a9ab64272b6d0610d2d9bef76e2fd6303139432b0e99fba8acf049abc8c21f74ec7ef28555
EBUILD streamlink-6.2.0.ebuild 1659 BLAKE2B 5b732dbacc0bd36345fcc68581829d7ec463bf3493a5eb34f5188645cdc0b57f64326bf6010b7dd209009b59ebfb9e377eccffcaef369c875fe14bbc7af5314a SHA512 95ddf3426d727908239d6c5be7e0f2543f8c83d7d77e04e9f89f25a9ab64272b6d0610d2d9bef76e2fd6303139432b0e99fba8acf049abc8c21f74ec7ef28555
EBUILD streamlink-6.2.1.ebuild 1872 BLAKE2B 0286827b0324f4d3f72b00b7b5fc3cb901d3be9bb7986e81d265fee05f7d19caf38f8244e6d004fd0ded695bbb9abddc8bc7ba0f46b7b348c73f1ad6a0ceb5cc SHA512 b27d6fa771a567ec6ac4a916bd103edf7c7149e253e384df6724aca8edd0c21980d04986492682ae547372b4b2923eea8a1c5a69aa231c4de703c16acd46089e
EBUILD streamlink-6.3.1.ebuild 1964 BLAKE2B 1e49538c8f14ac85bd9bb2898d9676d73a245b331359848fc134cd0335a0d4b11f55b334fd26f682eda2a71b13a4477c94ee7e0185190663896a139fada09612 SHA512 5d8f80bcc7fd4ad85fc39997f33bd7953e396755a45cbde491df775b5be40a0f65c9f9cf7092393ebddc02e0294bea3b0f9a2cbfe8ca5e6875d91668dd52bfe0
-EBUILD streamlink-9999.ebuild 1964 BLAKE2B 1e49538c8f14ac85bd9bb2898d9676d73a245b331359848fc134cd0335a0d4b11f55b334fd26f682eda2a71b13a4477c94ee7e0185190663896a139fada09612 SHA512 5d8f80bcc7fd4ad85fc39997f33bd7953e396755a45cbde491df775b5be40a0f65c9f9cf7092393ebddc02e0294bea3b0f9a2cbfe8ca5e6875d91668dd52bfe0
+EBUILD streamlink-6.4.0.ebuild 2250 BLAKE2B d0bc79568dadf1405661ef8de3399912cf184cce3244d06fbeb1b094a4ccc02abbbaabeec811dc7e03594462b3090c5e783882bd75b2a8eb289f48ab6c57a513 SHA512 7aabc9e7c39aa803bd3b4665134387e99a0cbabfcd2b692bd659720a4d69ab27976a92dde58ed85a17b621bef57ae35b5ad8409a3fc1f0547b8b433d6f670895
+EBUILD streamlink-9999.ebuild 2196 BLAKE2B baf9acc296269eb0ead0e12e0ee002398dc10d970fd9b32ab4159a10e7dad65ad9f047d40a5daa91b650d49ab4099526b79cfbd264d373b31f4ad05ce903b1c6 SHA512 3f5a6de5850f7880e723f5ac6f66e32c84878a8dfa7664d9303d942ff4ac80e56bf71eafdf3d8c1949c59720303623d9d58a64f2f8c58142c3add539aef87f83
MISC metadata.xml 374 BLAKE2B 8c5f72454d8d00a99c18328838cc9c3be82cd9d68405f6e702239b8475a9162f3ba945b142bf2f5762fcc4ac52cae95c8e2d5c0707b1028c11faba2341a2d8e9 SHA512 038e509b340b1cc31382b0a1edf0c273fe99ca7c8c40370039a01cf6a95101d1217db7fea64bc67f5c113c99d504ceb7256008c1539c4d7e13ad6ceb8b922a58
diff --git a/net-misc/streamlink/files/streamlink-6.4.0-libxml2-2.12.0.patch b/net-misc/streamlink/files/streamlink-6.4.0-libxml2-2.12.0.patch
new file mode 100644
index 000000000000..ed5fd30366d2
--- /dev/null
+++ b/net-misc/streamlink/files/streamlink-6.4.0-libxml2-2.12.0.patch
@@ -0,0 +1,199 @@
+https://github.com/streamlink/streamlink/commit/9d8156dd794ee0919297cd90d85bcc11b8a28358
+
+From 9d8156dd794ee0919297cd90d85bcc11b8a28358 Mon Sep 17 00:00:00 2001
+From: bastimeyer <mail@bastimeyer.de>
+Date: Tue, 21 Nov 2023 20:10:47 +0100
+Subject: [PATCH] utils.parse: fix libxml2 2.12.0 compatibility
+
+---
+ src/streamlink/compat.py | 11 ++++
+ src/streamlink/utils/parse.py | 17 +++++-
+ tests/utils/test_parse.py | 112 ++++++++++++++++++++++++++--------
+ 3 files changed, 114 insertions(+), 26 deletions(-)
+
+diff --git a/src/streamlink/compat.py b/src/streamlink/compat.py
+index c75201544d3..993bce64cfd 100644
+--- a/src/streamlink/compat.py
++++ b/src/streamlink/compat.py
+@@ -2,11 +2,22 @@
+ import sys
+
+
++# compatibility import of charset_normalizer/chardet via requests<3.0
++try:
++ from requests.compat import chardet as charset_normalizer # type: ignore
++except ImportError: # pragma: no cover
++ import charset_normalizer
++
++
+ is_darwin = sys.platform == "darwin"
+ is_win32 = os.name == "nt"
+
+
++detect_encoding = charset_normalizer.detect
++
++
+ __all__ = [
+ "is_darwin",
+ "is_win32",
++ "detect_encoding",
+ ]
+diff --git a/src/streamlink/utils/parse.py b/src/streamlink/utils/parse.py
+index 8c9f79c8b51..17479b81f59 100644
+--- a/src/streamlink/utils/parse.py
++++ b/src/streamlink/utils/parse.py
+@@ -4,6 +4,7 @@
+
+ from lxml.etree import HTML, XML
+
++from streamlink.compat import detect_encoding
+ from streamlink.plugin import PluginError
+
+
+@@ -51,7 +52,21 @@ def parse_html(
+ - Removes XML declarations of invalid XHTML5 documents
+ - Wraps errors in custom exception with a snippet of the data in the message
+ """
+- if isinstance(data, str) and data.lstrip().startswith("<?xml"):
++ # strip XML text declarations from XHTML5 documents which were incorrectly defined as HTML5
++ is_bytes = isinstance(data, bytes)
++ if data and data.lstrip()[:5].lower() == (b"<?xml" if is_bytes else "<?xml"):
++ if is_bytes:
++ # get the document's encoding using the "encoding" attribute value of the XML text declaration
++ match = re.match(rb"^\s*<\?xml\s.*?encoding=(?P<q>[\'\"])(?P<encoding>.+?)(?P=q).*?\?>", data, re.IGNORECASE)
++ if match:
++ encoding_value = detect_encoding(match["encoding"])["encoding"]
++ encoding = match["encoding"].decode(encoding_value)
++ else:
++ # no "encoding" attribute: try to figure out encoding from the document's content
++ encoding = detect_encoding(data)["encoding"]
++
++ data = data.decode(encoding)
++
+ data = re.sub(r"^\s*<\?xml.+?\?>", "", data)
+
+ return _parse(HTML, data, name, exception, schema, *args, **kwargs)
+diff --git a/tests/utils/test_parse.py b/tests/utils/test_parse.py
+index aedae7d4e8e..69c16f282b9 100644
+--- a/tests/utils/test_parse.py
++++ b/tests/utils/test_parse.py
+@@ -74,31 +74,93 @@ def test_parse_xml_entities(self):
+ assert actual.tag == expected.tag
+ assert actual.attrib == expected.attrib
+
+- def test_parse_xml_encoding(self):
+- tree = parse_xml("""<?xml version="1.0" encoding="UTF-8"?><test>ä</test>""")
+- assert tree.xpath(".//text()") == ["ä"]
+- tree = parse_xml("""<test>ä</test>""")
+- assert tree.xpath(".//text()") == ["ä"]
+- tree = parse_xml(b"""<?xml version="1.0" encoding="UTF-8"?><test>\xC3\xA4</test>""")
+- assert tree.xpath(".//text()") == ["ä"]
+- tree = parse_xml(b"""<test>\xC3\xA4</test>""")
+- assert tree.xpath(".//text()") == ["ä"]
+-
+- def test_parse_html_encoding(self):
+- tree = parse_html("""<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body>ä</body></html>""")
+- assert tree.xpath(".//body/text()") == ["ä"]
+- tree = parse_html("""<!DOCTYPE html><html><body>ä</body></html>""")
+- assert tree.xpath(".//body/text()") == ["ä"]
+- tree = parse_html(b"""<!DOCTYPE html><html><meta charset="utf-8"/><body>\xC3\xA4</body></html>""")
+- assert tree.xpath(".//body/text()") == ["ä"]
+- tree = parse_html(b"""<!DOCTYPE html><html><body>\xC3\xA4</body></html>""")
+- assert tree.xpath(".//body/text()") == ["ä"]
+-
+- def test_parse_html_xhtml5(self):
+- tree = parse_html("""<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html><html><body>ä?></body></html>""")
+- assert tree.xpath(".//body/text()") == ["ä?>"]
+- tree = parse_html(b"""<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html><html><body>\xC3\xA4?></body></html>""")
+- assert tree.xpath(".//body/text()") == ["ä?>"]
++ @pytest.mark.parametrize(("content", "expected"), [
++ pytest.param(
++ """<?xml version="1.0" encoding="UTF-8"?><test>ä</test>""",
++ "ä",
++ id="string-utf-8",
++ ),
++ pytest.param(
++ """<test>ä</test>""",
++ "ä",
++ id="string-unknown",
++ ),
++ pytest.param(
++ b"""<?xml version="1.0" encoding="UTF-8"?><test>\xC3\xA4</test>""",
++ "ä",
++ id="bytes-utf-8",
++ ),
++ pytest.param(
++ b"""<?xml version="1.0" encoding="ISO-8859-1"?><test>\xE4</test>""",
++ "ä",
++ id="bytes-iso-8859-1",
++ ),
++ pytest.param(
++ b"""<test>\xC3\xA4</test>""",
++ "ä",
++ id="bytes-unknown",
++ ),
++ ])
++ def test_parse_xml_encoding(self, content, expected):
++ tree = parse_xml(content)
++ assert tree.xpath(".//text()") == [expected]
++
++ @pytest.mark.parametrize(("content", "expected"), [
++ pytest.param(
++ """<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body>ä</body></html>""",
++ "ä",
++ id="string-utf-8",
++ ),
++ pytest.param(
++ """<!DOCTYPE html><html><body>ä</body></html>""",
++ "ä",
++ id="string-unknown",
++ ),
++ pytest.param(
++ b"""<!DOCTYPE html><html><head><meta charset="utf-8"/></head><body>\xC3\xA4</body></html>""",
++ "ä",
++ id="bytes-utf-8",
++ ),
++ pytest.param(
++ b"""<!DOCTYPE html><html><head><meta charset="ISO-8859-1"/></head><body>\xE4</body></html>""",
++ "ä",
++ id="bytes-iso-8859-1",
++ ),
++ pytest.param(
++ b"""<!DOCTYPE html><html><body>\xC3\xA4</body></html>""",
++ "ä",
++ id="bytes-unknown",
++ ),
++ ])
++ def test_parse_html_encoding(self, content, expected):
++ tree = parse_html(content)
++ assert tree.xpath(".//body/text()") == [expected]
++
++ @pytest.mark.parametrize(("content", "expected"), [
++ pytest.param(
++ """<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html><html><body>ä?></body></html>""",
++ "ä?>",
++ id="string",
++ ),
++ pytest.param(
++ b"""<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html><html><body>\xC3\xA4?></body></html>""",
++ "ä?>",
++ id="bytes-utf-8",
++ ),
++ pytest.param(
++ b"""<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html><html><body>\xE4?></body></html>""",
++ "ä?>",
++ id="bytes-iso-8859-1",
++ ),
++ pytest.param(
++ b"""<?xml version="1.0"?><!DOCTYPE html><html><body>\xC3\xA4?></body></html>""",
++ "ä?>",
++ id="bytes-unknown",
++ ),
++ ])
++ def test_parse_html_xhtml5(self, content, expected):
++ tree = parse_html(content)
++ assert tree.xpath(".//body/text()") == [expected]
+
+ def test_parse_qsd(self):
+ assert parse_qsd("test=1&foo=bar", schema=validate.Schema({"test": str, "foo": "bar"})) == {"test": "1", "foo": "bar"}
+
diff --git a/net-misc/streamlink/streamlink-6.4.0.ebuild b/net-misc/streamlink/streamlink-6.4.0.ebuild
new file mode 100644
index 000000000000..2c9ca567becc
--- /dev/null
+++ b/net-misc/streamlink/streamlink-6.4.0.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="https://github.com/streamlink/${PN}.git"
+ inherit git-r3
+fi
+
+DISTUTILS_SINGLE_IMPL=1
+# >= 6.2.1 uses a bunch of setuptools hooks instead of vanilla setuptools
+# https://github.com/streamlink/streamlink/commit/194d9bc193f5285bc1ba33af5fd89209a96ad3a7
+DISTUTILS_USE_PEP517=standalone
+PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_REQ_USE='xml(+),threads(+)'
+inherit distutils-r1
+
+DESCRIPTION="CLI for extracting streams from websites to a video player of your choice"
+HOMEPAGE="https://streamlink.github.io/"
+
+if [[ ${PV} != 9999* ]]; then
+ SRC_URI="https://github.com/streamlink/${PN}/releases/download/${PV}/${P}.tar.gz"
+fi
+
+LICENSE="BSD-2 Apache-2.0"
+SLOT="0"
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+# See https://github.com/streamlink/streamlink/commit/9d8156dd794ee0919297cd90d85bcc11b8a28358 for chardet/charset-normalizer dep
+RDEPEND="
+ media-video/ffmpeg
+ $(python_gen_cond_dep '
+ dev-python/certifi[${PYTHON_USEDEP}]
+ || (
+ dev-python/chardet[${PYTHON_USEDEP}]
+ dev-python/charset-normalizer[${PYTHON_USEDEP}]
+ )
+ >=dev-python/requests-2.26.0[${PYTHON_USEDEP}]
+ dev-python/isodate[${PYTHON_USEDEP}]
+ >=dev-python/lxml-4.6.4[${PYTHON_USEDEP}]
+ >=dev-python/websocket-client-1.2.1[${PYTHON_USEDEP}]
+ dev-python/pycountry[${PYTHON_USEDEP}]
+ >=dev-python/pycryptodome-3.4.3[${PYTHON_USEDEP}]
+ >dev-python/PySocks-1.5.7[${PYTHON_USEDEP}]
+ >=dev-python/trio-0.22.0[${PYTHON_USEDEP}]
+ >=dev-python/trio-websocket-0.9.0[${PYTHON_USEDEP}]
+ >=dev-python/urllib3-1.26.0[${PYTHON_USEDEP}]
+ ')
+"
+BDEPEND="
+ $(python_gen_cond_dep '
+ >=dev-python/setuptools-64[${PYTHON_USEDEP}]
+ >=dev-python/versioningit-2.0.0[${PYTHON_USEDEP}]
+ test? (
+ >=dev-python/freezegun-1.0.0[${PYTHON_USEDEP}]
+ dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/pytest-trio[${PYTHON_USEDEP}]
+ dev-python/requests-mock[${PYTHON_USEDEP}]
+ )
+ ')
+"
+
+if [[ ${PV} == 9999* ]]; then
+ RDEPEND+="
+ $(python_gen_cond_dep '
+ >=dev-python/versioningit-2.0.0[${PYTHON_USEDEP}]
+ ')
+ "
+fi
+
+PATCHES=(
+ "${FILESDIR}"/${P}-libxml2-2.12.0.patch
+)
+
+distutils_enable_tests pytest
diff --git a/net-misc/streamlink/streamlink-9999.ebuild b/net-misc/streamlink/streamlink-9999.ebuild
index 05ac7784a3e8..d73952536218 100644
--- a/net-misc/streamlink/streamlink-9999.ebuild
+++ b/net-misc/streamlink/streamlink-9999.ebuild
@@ -29,10 +29,15 @@ if [[ ${PV} != 9999* ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi
+# See https://github.com/streamlink/streamlink/commit/9d8156dd794ee0919297cd90d85bcc11b8a28358 for chardet/charset-normalizer dep
RDEPEND="
media-video/ffmpeg
$(python_gen_cond_dep '
dev-python/certifi[${PYTHON_USEDEP}]
+ || (
+ dev-python/chardet[${PYTHON_USEDEP}]
+ dev-python/charset-normalizer[${PYTHON_USEDEP}]
+ )
>=dev-python/requests-2.26.0[${PYTHON_USEDEP}]
dev-python/isodate[${PYTHON_USEDEP}]
>=dev-python/lxml-4.6.4[${PYTHON_USEDEP}]