jxxghp
2024-05-10 20:17:57 +08:00
parent a28301086e
commit a9f1345ec1
2 changed files with 8 additions and 4 deletions

View File

@@ -675,9 +675,12 @@
"name": "登录壁纸本地化",
"description": "将MoviePilot的登录壁纸下载到本地。",
"labels": "工具",
"version": "1.0",
"version": "1.1",
"icon": "Macos_Sierra.png",
"author": "jxxghp",
"level": 1
"level": 1,
"history": {
"v1.1": "修复下载Bing每日壁纸时文件名错乱的问题"
}
}
}

View File

@@ -21,7 +21,7 @@ class TmdbWallpaper(_PluginBase):
# 插件图标
plugin_icon = "Macos_Sierra.png"
# 插件版本
plugin_version = "1.0"
plugin_version = "1.1"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -224,12 +224,13 @@ class TmdbWallpaper(_PluginBase):
return
if settings.WALLPAPER == "tmdb":
url = TmdbChain().get_random_wallpager()
filename = url.split("/")[-1]
else:
url = WebUtils.get_bing_wallpaper()
filename = f"{datetime.now().strftime('%Y%m%d')}.jpg"
# 下载壁纸
if url:
try:
filename = url.split("/")[-1]
savepath = Path(self._savepath)
logger.info(f"下载壁纸:{url}")
with RequestUtils().get_res(url) as r: