Skip to content

Commit

Permalink
fix: Add random letters after api url to reset response cache
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Jan 2, 2025
1 parent b8c4c00 commit 765fafa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion genshin/utility/extdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import logging
import time
import typing
import random
import string
import warnings
from base64 import b64decode as parse_token

Expand Down Expand Up @@ -190,7 +192,10 @@ async def update_characters_enka(langs: typing.Sequence[str] = ()) -> None:
async def update_characters_ambr(langs: typing.Sequence[str] = ()) -> None:
"""Update characters with https://ambr.top/."""
langs = langs or list(LANGS.keys())
urls = [AMBR_URL.format(lang=LANG_MAP[lang]) for lang in langs]
urls = [
AMBR_URL.format(lang=LANG_MAP[lang]) + f"?{''.join(random.choices(string.ascii_letters, k=5))}"
for lang in langs
]

characters_list = await _fetch_jsons(*urls)

Expand Down

0 comments on commit 765fafa

Please sign in to comment.