1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[fix] peertube: update _fetch_supported_languages

update the regex to match the changes in peertube source code
fix "make data.languages"
This commit is contained in:
Alexandre Flament 2021-07-23 12:03:16 +02:00
parent ea0f4346b1
commit b0a12924a0

View File

@ -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