From 2aa95c16e31ff0d688a06492863b9f2a0c209bfb Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 29 Nov 2019 14:47:43 +0100 Subject: [PATCH] [fix] soundcloud: URLs of JS sources has been moved The client_id is found under (new) URL: https://a-v2.sndcdn.com/assets/49-a0c01933-3.js Signed-off-by: Markus Heiser --- searx/engines/soundcloud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py index 87099854..284689bf 100644 --- a/searx/engines/soundcloud.py +++ b/searx/engines/soundcloud.py @@ -51,7 +51,9 @@ def get_client_id(): if response.ok: tree = html.fromstring(response.content) - script_tags = tree.xpath("//script[contains(@src, '/assets/app')]") + # script_tags has been moved from /assets/app/ to /assets/ path. I + # found client_id in https://a-v2.sndcdn.com/assets/49-a0c01933-3.js + script_tags = tree.xpath("//script[contains(@src, '/assets/')]") 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