fix
This commit is contained in:
parent
957c6a00eb
commit
a7447ffcb7
1 changed files with 4 additions and 2 deletions
|
@ -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}'
|
||||
|
|
Reference in a new issue