mirror of
https://github.com/thsrite/MoviePilot-Plugins.git
synced 2026-03-27 10:05:57 +00:00
fix 二级分类自定义填充支持保存路径
This commit is contained in:
@@ -33,5 +33,5 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/
|
||||
- docker自定义任务 1.2
|
||||
- 插件彻底卸载 1.0
|
||||
- 实时软连接 1.3
|
||||
- 订阅规则自动填充 2.2
|
||||
- 订阅规则自动填充 2.3
|
||||
|
||||
|
||||
@@ -322,11 +322,12 @@
|
||||
"SubscribeGroup": {
|
||||
"name": "订阅规则自动填充",
|
||||
"description": "电视剧下载后自动添加官组等信息到订阅;添加订阅后根据二级分类名称自定义订阅规则。",
|
||||
"version": "2.2",
|
||||
"version": "2.3",
|
||||
"icon": "teamwork.png",
|
||||
"author": "thsrite",
|
||||
"level": 2,
|
||||
"history": {
|
||||
"v2.3": "二级分类自定义填充支持保存路径",
|
||||
"v2.2": "优化",
|
||||
"v2.1": "站点与官组分开,修复质量无填充",
|
||||
"v2.0": "种子下载自定义填充支持自定义占位符",
|
||||
|
||||
@@ -20,7 +20,7 @@ class SubscribeGroup(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "teamwork.png"
|
||||
# 插件版本
|
||||
plugin_version = "2.2"
|
||||
plugin_version = "2.3"
|
||||
# 插件作者
|
||||
plugin_author = "thsrite"
|
||||
# 作者主页
|
||||
@@ -66,6 +66,7 @@ class SubscribeGroup(_PluginBase):
|
||||
effect = None
|
||||
include = None
|
||||
exclude = None
|
||||
savepath = None
|
||||
sites = []
|
||||
for conf in str(confs).split("#"):
|
||||
if ":" in conf:
|
||||
@@ -82,6 +83,8 @@ class SubscribeGroup(_PluginBase):
|
||||
include = v
|
||||
if k == "exclude":
|
||||
exclude = v
|
||||
if k == "savepath":
|
||||
savepath = v
|
||||
if k == "sites":
|
||||
for site_name in str(v).split(","):
|
||||
for active_site in active_sites:
|
||||
@@ -96,6 +99,7 @@ class SubscribeGroup(_PluginBase):
|
||||
'effect': effect,
|
||||
'include': include,
|
||||
'exclude': exclude,
|
||||
'savepath': savepath,
|
||||
'sites': sites
|
||||
}
|
||||
logger.info(f"获取到二级分类自定义配置 {len(self._subscribe_confs.keys())} 个")
|
||||
@@ -167,25 +171,25 @@ class SubscribeGroup(_PluginBase):
|
||||
# 二级分类自定义配置
|
||||
category_conf = self._subscribe_confs.get(category)
|
||||
|
||||
update_dict = {}
|
||||
if category_conf.get('include'):
|
||||
update_dict['include'] = category_conf.get('include')
|
||||
if category_conf.get('exclude'):
|
||||
update_dict['exclude'] = category_conf.get('exclude')
|
||||
if category_conf.get('sites'):
|
||||
update_dict['sites'] = json.dumps(category_conf.get('sites'))
|
||||
if category_conf.get('resolution'):
|
||||
update_dict['resolution'] = self.__parse_pix(category_conf.get('resolution'))
|
||||
if category_conf.get('quality'):
|
||||
update_dict['quality'] = self.__parse_type(category_conf.get('quality'))
|
||||
if category_conf.get('effect'):
|
||||
update_dict['effect'] = self.__parse_effect(category_conf.get('effect'))
|
||||
if category_conf.get('savepath'):
|
||||
update_dict['savepath'] = category_conf.get('savepath')
|
||||
|
||||
# 更新订阅自定义配置
|
||||
self._subscribeoper.update(sid, {
|
||||
'include': category_conf.get('include') if category_conf.get('include') else subscribe.include,
|
||||
'exclude': category_conf.get('exclude') if category_conf.get('exclude') else subscribe.exclude,
|
||||
'sites': json.dumps(category_conf.get('sites')) if category_conf.get('sites') else subscribe.sites,
|
||||
'resolution': self.__parse_pix(category_conf.get('resolution')) if category_conf.get(
|
||||
'resolution') else subscribe.resolution,
|
||||
'quality': self.__parse_type(category_conf.get('quality')) if category_conf.get(
|
||||
'quality') else subscribe.quality,
|
||||
'effect': self.__parse_effect(category_conf.get('effect')) if category_conf.get(
|
||||
'effect') else subscribe.effect,
|
||||
})
|
||||
logger.info(f"订阅记录:{subscribe.name} 填充成功\n"
|
||||
f"包含关键词 {category_conf.get('include') if category_conf.get('include') else subscribe.include} \n"
|
||||
f"排除关键词 {category_conf.get('exclude') if category_conf.get('exclude') else subscribe.exclude} \n"
|
||||
f"站点 {json.dumps(category_conf.get('sites')) if category_conf.get('sites') else subscribe.sites} \n"
|
||||
f"分辨率 {self.__parse_pix(category_conf.get('resolution')) if category_conf.get('resolution') else subscribe.resolution} \n"
|
||||
f"质量 {self.__parse_type(category_conf.get('quality')) if category_conf.get('quality') else subscribe.quality} \n"
|
||||
f"特效 {self.__parse_effect(category_conf.get('effect')) if category_conf.get('effect') else subscribe.effect}")
|
||||
self._subscribeoper.update(sid, update_dict)
|
||||
logger.info(f"订阅记录:{subscribe.name} 填充成功\n{update_dict}")
|
||||
|
||||
# 读取历史记录
|
||||
history = self.get_data('history') or []
|
||||
@@ -193,7 +197,7 @@ class SubscribeGroup(_PluginBase):
|
||||
history.append({
|
||||
'name': subscribe.name,
|
||||
'type': f'二级分类自定义配置 {category}',
|
||||
'content': json.dumps(category_conf),
|
||||
'content': json.dumps(update_dict),
|
||||
"time": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
|
||||
})
|
||||
# 保存历史
|
||||
@@ -584,7 +588,7 @@ class SubscribeGroup(_PluginBase):
|
||||
'type': 'info',
|
||||
'variant': 'tonal',
|
||||
'text': 'category:二级分类名称(多个分类名称逗号拼接),resolution:分辨率,quality:质量,effect:特效,include:包含关键词,'
|
||||
'exclude:排除关键词,sites:站点名称(多个站点用逗号拼接)。'
|
||||
'exclude:排除关键词,sites:站点名称(多个站点用逗号拼接),savepath:保存路径。'
|
||||
'category必填,多组属性用#分割。例如category:动漫#resolution:1080p'
|
||||
'(添加的动漫订阅,指定分辨率为1080p)。'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user