Archived
1
0
Fork 0
This commit is contained in:
多羅狼 2024-01-25 18:54:38 +08:00 committed by GitHub
parent 957c6a00eb
commit a7447ffcb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -191,8 +191,10 @@ async def download_to_cache(url: str, filename=None, status_code: int = False, m
if data:
if not filename:
ftt = ft.match(data).extension
ftt = '.txt' if not ftt else ftt
try:
ftt = ft.match(data).extension
except AttributeError:
ftt = 'txt'
path = f'{random_cache_path()}.{ftt}'
else:
path = Config("cache_path") + f'/{filename}'