diff options
author | kqlio67 <kqlio67@users.noreply.github.com> | 2024-11-13 21:48:01 +0100 |
---|---|---|
committer | kqlio67 <kqlio67@users.noreply.github.com> | 2024-11-13 21:48:01 +0100 |
commit | 054eef11cbb31dafd3a259d9fc92057aa22e93d4 (patch) | |
tree | 9cc9b222dc9b0d6bf80d656f6cfb300f168d3ce9 /g4f | |
parent | ### refactor(g4f/Provider/Blackbox.py): Optimize fetch_validated method (diff) | |
download | gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.tar gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.tar.gz gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.tar.bz2 gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.tar.lz gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.tar.xz gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.tar.zst gpt4free-054eef11cbb31dafd3a259d9fc92057aa22e93d4.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/Blackbox.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/Blackbox.py b/g4f/Provider/Blackbox.py index 8eb310b6..8d820344 100644 --- a/g4f/Provider/Blackbox.py +++ b/g4f/Provider/Blackbox.py @@ -86,11 +86,11 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin): @classmethod async def fetch_validated(cls): - # Якщо ключ вже збережений в пам'яті, повертаємо його + # If the key is already stored in memory, return it if cls._last_validated_value: return cls._last_validated_value - # Якщо ключ не знайдено, виконуємо пошук + # If the key is not found, perform a search async with aiohttp.ClientSession() as session: try: async with session.get(cls.url) as response: @@ -111,7 +111,7 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin): match = key_pattern.search(js_content) if match: validated_value = match.group(1) - cls._last_validated_value = validated_value # Зберігаємо в пам'яті + cls._last_validated_value = validated_value # Keep in mind return validated_value except Exception as e: print(f"Error fetching validated value: {e}") |