mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-31 07:26:44 +00:00
fix TmdbWallpaper
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
from typing import Any, List, Dict, Tuple
|
||||
from urllib.parse import urlparse
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
|
||||
import pytz
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
@@ -21,7 +21,7 @@ class TmdbWallpaper(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "Macos_Sierra.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.4"
|
||||
plugin_version = "1.4.1"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -242,12 +242,13 @@ class TmdbWallpaper(_PluginBase):
|
||||
if settings.WALLPAPER == "tmdb":
|
||||
filename = url.split("/")[-1]
|
||||
elif settings.WALLPAPER == "bing":
|
||||
# https://cn.bing.com/th?id=OHR.EchinaceaButterfly_EN-US8404044892_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp
|
||||
# 解析url参数,获取id的值
|
||||
url_params = urlparse(url)
|
||||
filename = url_params.query.split("id=")[-1]
|
||||
parsed_url = urlparse(url)
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
param_value = query_params.get("id")
|
||||
filename = param_value[0] if param_value else None
|
||||
else:
|
||||
# 其他壁纸类型,直接使用url的文件名
|
||||
# 其他壁纸类型,直接使用url的文件名hash
|
||||
filename = url.split("/")[-1]
|
||||
# 没有后缀的文件名,添加.jpg后缀
|
||||
if not filename.endswith(".jpg"):
|
||||
|
||||
Reference in New Issue
Block a user