summaryrefslogtreecommitdiff
path: root/net-analyzer/speedtest-cli
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-05-07 17:37:01 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-05-07 17:37:01 +0100
commit2fe5661a32d6ec0ba1d6b37cc8ae67e3f81459ec (patch)
treef41d653fa88967e28246f7b63dba9f2fd7be2ab7 /net-analyzer/speedtest-cli
parent6e88bac8dd26372eea042112ad3769b1fac9ae18 (diff)
gentoo auto-resync : 07:05:2023 - 17:37:01
Diffstat (limited to 'net-analyzer/speedtest-cli')
-rw-r--r--net-analyzer/speedtest-cli/Manifest3
-rw-r--r--net-analyzer/speedtest-cli/files/speedtest-cli-2.1.3-json-serverlist.patch88
-rw-r--r--net-analyzer/speedtest-cli/speedtest-cli-2.1.3-r2.ebuild (renamed from net-analyzer/speedtest-cli/speedtest-cli-2.1.3-r1.ebuild)2
3 files changed, 92 insertions, 1 deletions
diff --git a/net-analyzer/speedtest-cli/Manifest b/net-analyzer/speedtest-cli/Manifest
index 8d13202e14e4..7413bd109a33 100644
--- a/net-analyzer/speedtest-cli/Manifest
+++ b/net-analyzer/speedtest-cli/Manifest
@@ -1,3 +1,4 @@
+AUX speedtest-cli-2.1.3-json-serverlist.patch 3481 BLAKE2B b01c81d272cfc3bb406332fee7472f2c114ec13ea2e16281173c932e55e0177d08e6580ac682e4fba6e72b9957c3f67927bfd030cdae74e2f852f80da1a043ac SHA512 2280b41befdeac3b8be8c5218a7632fea21f9bc886b220ce9801e8287f60de980085ac191a1c81330bc92b4611a06bb2e97e90b34b7b5c904981d546e4971959
DIST speedtest-cli-2.1.3.tar.gz 24771 BLAKE2B 70c604848ffa29ae0a28a636a40ffdd278000c865b243038f773d20a4f6f1c668704505c8bae302d84a0957b2a6ad9d4b303e2e9371b351348d7147ff9a5a67d SHA512 e2ecd9b4eea95e3641045c3da217ec5a39846b26c1f773fdd31c6ffe3cb5e35341320fc1992f865af48afd1a704c4d4224f9ec4048abb69131ee2f32385ae94c
-EBUILD speedtest-cli-2.1.3-r1.ebuild 638 BLAKE2B 797f9e64545470398c99e0b511661c6f2f25b7cccc5b700900557f62ca710c7e493d47ea5ec8f6540535b205d5b04dc128293dd2ed85dc88a0078d1a53521e69 SHA512 7760c6eb3cc89fe3d5eccc53e04bd8f854ad768f5dcd95d5075e6a617e9588b05b98c89e5e26ffd7c8df44222860f27cde28fa601d5babd1e193e135dbb7edc7
+EBUILD speedtest-cli-2.1.3-r2.ebuild 699 BLAKE2B ff82313f56b94ac383612c5904ba97e56e0ca0b86051831b8e9a042b49344c74cc72345df236359cc7cd48ac0d5ff786b9070dad8e49d06c9b01bccc84a78216 SHA512 0fe92ee9fd4b38cb452761c3d0ce44447814510db1e402e4f7f3d36339e11542c3c8e2a61f37107470e48f62e8c03b254b17d9fb2e79d757682322c403a7b5f0
MISC metadata.xml 335 BLAKE2B f1b79bcb4a155fa139e30ffd3f15adff28f9fb3c48bf004237c5ed585fecbd6ea0808e98473cb78e64fc6f3eca11f28d1bc1ea1fe74533fb611a3e9dc372775c SHA512 e68b95452606d13854bbc1e4af0fd56332363c8c42273655cdd6c5ae92619ff33157338a80d32ce1cd1a04d666058d536fe61e4f0334b4c2b71a033862fe0167
diff --git a/net-analyzer/speedtest-cli/files/speedtest-cli-2.1.3-json-serverlist.patch b/net-analyzer/speedtest-cli/files/speedtest-cli-2.1.3-json-serverlist.patch
new file mode 100644
index 000000000000..455fd4bfd2eb
--- /dev/null
+++ b/net-analyzer/speedtest-cli/files/speedtest-cli-2.1.3-json-serverlist.patch
@@ -0,0 +1,88 @@
+diff --git a/speedtest.py b/speedtest.py
+index a33296d..e7490b1 100755
+--- a/speedtest.py
++++ b/speedtest.py
+@@ -20,6 +20,7 @@ import re
+ import csv
+ import sys
+ import math
++import json
+ import errno
+ import signal
+ import socket
+@@ -1250,10 +1251,7 @@ class Speedtest(object):
+ )
+
+ urls = [
+- '://www.speedtest.net/speedtest-servers-static.php',
+- 'http://c.speedtest.net/speedtest-servers-static.php',
+- '://www.speedtest.net/speedtest-servers.php',
+- 'http://c.speedtest.net/speedtest-servers.php',
++ "://www.speedtest.net/api/js/servers",
+ ]
+
+ headers = {}
+@@ -1296,53 +1294,31 @@ class Speedtest(object):
+ printer('Servers XML:\n%s' % serversxml, debug=True)
+
+ try:
+- try:
+- try:
+- root = ET.fromstring(serversxml)
+- except ET.ParseError:
+- e = get_exception()
+- raise SpeedtestServersError(
+- 'Malformed speedtest.net server list: %s' % e
+- )
+- elements = etree_iter(root, 'server')
+- except AttributeError:
+- try:
+- root = DOM.parseString(serversxml)
+- except ExpatError:
+- e = get_exception()
+- raise SpeedtestServersError(
+- 'Malformed speedtest.net server list: %s' % e
+- )
+- elements = root.getElementsByTagName('server')
+- except (SyntaxError, xml.parsers.expat.ExpatError):
++ elements = json.loads(serversxml)
++ except SyntaxError:
+ raise ServersRetrievalError()
+
+ for server in elements:
+- try:
+- attrib = server.attrib
+- except AttributeError:
+- attrib = dict(list(server.attributes.items()))
+-
+- if servers and int(attrib.get('id')) not in servers:
++ if servers and int(server.get('id')) not in servers:
+ continue
+
+- if (int(attrib.get('id')) in self.config['ignore_servers']
+- or int(attrib.get('id')) in exclude):
++ if (int(server.get('id')) in self.config['ignore_servers']
++ or int(server.get('id')) in exclude):
+ continue
+
+ try:
+ d = distance(self.lat_lon,
+- (float(attrib.get('lat')),
+- float(attrib.get('lon'))))
++ (float(server.get('lat')),
++ float(server.get('lon'))))
+ except Exception:
+ continue
+
+- attrib['d'] = d
++ server['d'] = d
+
+ try:
+- self.servers[d].append(attrib)
++ self.servers[d].append(server)
+ except KeyError:
+- self.servers[d] = [attrib]
++ self.servers[d] = [server]
+
+ break
+
diff --git a/net-analyzer/speedtest-cli/speedtest-cli-2.1.3-r1.ebuild b/net-analyzer/speedtest-cli/speedtest-cli-2.1.3-r2.ebuild
index 57075996b3fe..4fb0e2fc1022 100644
--- a/net-analyzer/speedtest-cli/speedtest-cli-2.1.3-r1.ebuild
+++ b/net-analyzer/speedtest-cli/speedtest-cli-2.1.3-r2.ebuild
@@ -19,6 +19,8 @@ KEYWORDS="amd64 ~arm ~arm64 ppc ppc64 x86"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
+PATCHES=( "${FILESDIR}/${PN}-2.1.3-json-serverlist.patch" )
+
python_install_all() {
doman ${PN}.1
distutils-r1_python_install_all