This commit is contained in:
jxxghp
2024-10-12 12:32:50 +08:00
parent 0d139851af
commit 4e3a76ffa3
4 changed files with 24 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, List
from cachetools import TTLCache, cached
@@ -94,7 +94,7 @@ class WebUtils:
@staticmethod
@cached(cache=TTLCache(maxsize=1, ttl=3600))
def get_bing_wallpapers(num: int = 7) -> Optional[str]:
def get_bing_wallpapers(num: int = 7) -> List[str]:
"""
获取7天的Bing每日壁纸
"""
@@ -107,4 +107,4 @@ class WebUtils:
return [f"https://cn.bing.com{image.get('url')}" for image in result.get('images') or []]
except Exception as err:
print(str(err))
return None
return []