summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-03-21 09:29:53 +0100
committerGitHub <noreply@github.com>2021-03-21 09:29:53 +0100
commit38c210d7468d709a77e1a45bacfba87fd0975bef (patch)
treed14758b9532c616428e136211b2fc67193254d89 /searx/engines
parent12fa524cf7ceb6bb7c85307420551a13e95a1ada (diff)
downloadsearxng-38c210d7468d709a77e1a45bacfba87fd0975bef.tar.gz
searxng-38c210d7468d709a77e1a45bacfba87fd0975bef.zip
[mod] soundcloud: faster initialization
The get_cliend_id() function: * fetches https://soundcloud.com * then fetches each referenced javascript URL to get the client id. This commit fetches the javascript URLs in the reverse order: the client id is in the last javascript URL.
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/soundcloud.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index 9e414746f..b3e3383bd 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -55,7 +55,7 @@ def get_client_id():
app_js_urls = [script_tag.get('src') for script_tag in script_tags if script_tag is not None]
# extracts valid app_js urls from soundcloud.com content
- for app_js_url in app_js_urls:
+ for app_js_url in app_js_urls[::-1]:
# gets app_js and searches for the clientid
response = http_get(app_js_url)
if response.ok: