From a72b37bc34fc4c5fb81415d7885d4c45498e8eb3 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Fri, 23 Jul 2021 17:23:57 +0200 Subject: [PATCH] reformat proxy env --- backend/stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/stream.py b/backend/stream.py index 42f79a4..d7f6748 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -69,7 +69,7 @@ class ProxyElem(): proxies = {} new_providers = {} for key in providers: - expr = re.compile(f'{key}_([a-z][a-z])?[0-9]+', re.IGNORECASE) + expr = re.compile(f'^{key}_proxy(_[a-z][a-z])?[0-9]+$', re.IGNORECASE) matches = list(filter(expr.match, os.environ.keys())) current = [] current_keys = set() @@ -81,7 +81,7 @@ for key in providers: country = None pos = len(country_groups) - 1 if pos >= 0: - country = country_groups[pos] + country = country_groups[pos].strip("_") current_keys.add(f'{key}_{country}') proxy = os.environ.get(match) if proxy is not None: