diff options
author | Alexandre Flament <alex@al-f.net> | 2021-07-23 12:03:16 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-07-23 12:03:16 +0200 |
commit | b0a12924a0c644e5eb43b873a332039684216bfd (patch) | |
tree | a3a4855062f1d924f3cd7b745cf9ace7b02bdf69 /searx/engines/peertube.py | |
parent | ea0f4346b13527c601bfcfb1f5d17a13b3dfc15c (diff) | |
download | searxng-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.py | 2 |
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 |