mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-24 07:26:48 +00:00
fix
This commit is contained in:
@@ -93,11 +93,12 @@
|
||||
"name": "豆瓣榜单订阅",
|
||||
"description": "监控豆瓣热门榜单,自动添加订阅。",
|
||||
"labels": "订阅",
|
||||
"version": "1.9",
|
||||
"version": "1.9.1",
|
||||
"icon": "movie.jpg",
|
||||
"author": "jxxghp",
|
||||
"level": 2,
|
||||
"history": {
|
||||
"v1.9.1": "优化媒体类型的判断处理",
|
||||
"v1.9": "增强API安全性",
|
||||
"v1.8": "订阅历史记录支持手动删除,需要主程序升级至v1.8.4+版本"
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ from app.core.context import MediaInfo
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.log import logger
|
||||
from app.plugins import _PluginBase
|
||||
from app.schemas import MediaType
|
||||
from app.utils.dom import DomUtils
|
||||
from app.utils.http import RequestUtils
|
||||
|
||||
@@ -29,7 +30,7 @@ class DoubanRank(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "movie.jpg"
|
||||
# 插件版本
|
||||
plugin_version = "1.9"
|
||||
plugin_version = "1.9.1"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -551,10 +552,15 @@ class DoubanRank(_PluginBase):
|
||||
if self._event.is_set():
|
||||
logger.info(f"订阅服务停止")
|
||||
return
|
||||
|
||||
mtype = None
|
||||
title = rss_info.get('title')
|
||||
douban_id = rss_info.get('doubanid')
|
||||
year = rss_info.get('year')
|
||||
type_str = rss_info.get('type')
|
||||
if type_str == "movie":
|
||||
mtype = MediaType.MOVIE
|
||||
elif type_str:
|
||||
mtype = MediaType.TV
|
||||
unique_flag = f"doubanrank: {title} (DB:{douban_id})"
|
||||
# 检查是否已处理过
|
||||
if unique_flag in [h.get("unique") for h in history]:
|
||||
@@ -562,6 +568,8 @@ class DoubanRank(_PluginBase):
|
||||
# 元数据
|
||||
meta = MetaInfo(title)
|
||||
meta.year = year
|
||||
if mtype:
|
||||
meta.type = mtype
|
||||
# 识别媒体信息
|
||||
if douban_id:
|
||||
# 识别豆瓣信息
|
||||
|
||||
@@ -945,7 +945,7 @@ class IYUUAutoSeed(_PluginBase):
|
||||
if not apikey:
|
||||
logger.error("m-team站点的apikey未配置")
|
||||
return None
|
||||
with RequestUtils(
|
||||
res = RequestUtils(
|
||||
headers={
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': f'{site.get("ua")}',
|
||||
@@ -954,11 +954,11 @@ class IYUUAutoSeed(_PluginBase):
|
||||
}
|
||||
).post_res(f"{site.get('url')}api/torrent/genDlToken", params={
|
||||
'id': tid
|
||||
}) as res:
|
||||
if not res:
|
||||
logger.warn(f"m-team 获取种子下载链接失败:{tid}")
|
||||
return None
|
||||
return res.json().get("data")
|
||||
})
|
||||
if not res:
|
||||
logger.warn(f"m-team 获取种子下载链接失败:{tid}")
|
||||
return None
|
||||
return res.json().get("data")
|
||||
|
||||
def __is_special_site(url: str):
|
||||
"""
|
||||
|
||||
@@ -233,10 +233,10 @@ class TmdbWallpaper(_PluginBase):
|
||||
try:
|
||||
savepath = Path(self._savepath)
|
||||
logger.info(f"下载壁纸:{url}")
|
||||
with RequestUtils().get_res(url) as r:
|
||||
if r and r.status_code == 200:
|
||||
with open(savepath / filename, "wb") as f:
|
||||
f.write(r.content)
|
||||
r = RequestUtils().get_res(url)
|
||||
if r and r.status_code == 200:
|
||||
with open(savepath / filename, "wb") as f:
|
||||
f.write(r.content)
|
||||
except Exception as e:
|
||||
logger.error(f"下载壁纸失败:{str(e)}")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user