summaryrefslogtreecommitdiff
path: root/searx/engines/peertube.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-07-23 12:03:16 +0200
committerAlexandre Flament <alex@al-f.net>2021-07-23 12:03:16 +0200
commitb0a12924a0c644e5eb43b873a332039684216bfd (patch)
treea3a4855062f1d924f3cd7b745cf9ace7b02bdf69 /searx/engines/peertube.py
parentea0f4346b13527c601bfcfb1f5d17a13b3dfc15c (diff)
downloadsearxng-b0a12924a0c644e5eb43b873a332039684216bfd.tar.gz
searxng-b0a12924a0c644e5eb43b873a332039684216bfd.zip
[fix] peertube: update _fetch_supported_languages
update the regex to match the changes in peertube source code fix "make data.languages"
Diffstat (limited to 'searx/engines/peertube.py')
-rw-r--r--searx/engines/peertube.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/peertube.py b/searx/engines/peertube.py
index 86cd04f2d..058065c03 100644
--- a/searx/engines/peertube.py
+++ b/searx/engines/peertube.py
@@ -97,6 +97,6 @@ def _fetch_supported_languages(resp):
import re
# https://docs.python.org/3/howto/regex.html#greedy-versus-non-greedy
- videolanguages = re.search(r"videoLanguages \(\) \{(.*?)\]", resp.text, re.DOTALL)
+ videolanguages = re.search(r"videoLanguages \(\)[^\n]+(.*?)\]", resp.text, re.DOTALL)
peertube_languages = [m.group(1) for m in re.finditer(r"\{ id: '([a-z]+)', label:", videolanguages.group(1))]
return peertube_languages