laforge submitted this change.
libgsmhr/fetch_sources: fix download from 3gpp.org
Fix that the script gets a 403 forbidden error since 2026-01-26. Set a
user-agent string and switch the protocol to https while at it.
Change-Id: I5679bc519e7891e3342d8e78c11bf5eb6b44a217
---
M libgsmhr/fetch_sources.py
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libgsmhr/fetch_sources.py b/libgsmhr/fetch_sources.py
index 178125c..a7b185a 100755
--- a/libgsmhr/fetch_sources.py
+++ b/libgsmhr/fetch_sources.py
@@ -8,7 +8,8 @@
import zipfile
-URL = "http://www.3gpp.org/ftp/Specs/archive/06_series/06.06/0606-421.zip"
+URL = "https://www.3gpp.org/ftp/Specs/archive/06_series/06.06/0606-421.zip"
+USER_AGENT = "fetch_sources.py"
def get_zipfile(data: bytes) -> zipfile.ZipFile:
@@ -45,7 +46,8 @@
# Get the original data
log.info('Requesting file: %s', URL)
- with urllib.request.urlopen(URL) as response:
+ request = urllib.request.Request(URL, headers={"User-Agent": USER_AGENT})
+ with urllib.request.urlopen(request) as response:
log.debug('Response code: %d', response.code)
assert response.code == 200
To view, visit change 42134. To unsubscribe, or for help writing mail filters, visit settings.