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: