Merge branch 'jxxghp:main' into main

This commit is contained in:
ljmeng
2024-03-27 19:35:19 +08:00
committed by GitHub
6 changed files with 22 additions and 45 deletions

View File

@@ -2,7 +2,7 @@
"AutoSignIn": {
"name": "站点自动签到",
"description": "自动模拟登录站点、签到。",
"version": "1.7",
"version": "1.8",
"icon": "signin.png",
"author": "thsrite",
"level": 2
@@ -18,7 +18,7 @@
"SiteStatistic": {
"name": "站点数据统计",
"description": "自动统计和展示站点数据。",
"version": "2.5",
"version": "2.6",
"icon": "statistic.png",
"author": "lightolly",
"level": 2
@@ -34,7 +34,7 @@
"DoubanSync": {
"name": "豆瓣想看",
"description": "同步豆瓣想看数据,自动添加订阅。",
"version": "1.4",
"version": "1.5",
"icon": "douban.png",
"author": "jxxghp",
"level": 2

View File

@@ -37,7 +37,7 @@ class AutoSignIn(_PluginBase):
# 插件图标
plugin_icon = "signin.png"
# 插件版本
plugin_version = "1.7"
plugin_version = "1.8"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -966,7 +966,7 @@ class AutoSignIn(_PluginBase):
"""
if not site_info:
return ""
state, msg = self.sitechain.test(site_info.get("url"))
state, msg = self.sitechain.test(site_info)
if state:
return f"模拟登陆成功"
else:

View File

@@ -33,7 +33,7 @@ class DoubanSync(_PluginBase):
# 插件图标
plugin_icon = "douban.png"
# 插件版本
plugin_version = "1.4"
plugin_version = "1.5"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -522,41 +522,16 @@ class DoubanSync(_PluginBase):
logger.info(f'{mediainfo.title_year} 媒体库中已存在')
action = "exist"
else:
logger.info(f'{mediainfo.title_year} 媒体库中不存在,开始搜索 ...')
# 搜索
contexts = self.searchchain.process(mediainfo=mediainfo,
no_exists=no_exists)
if not contexts:
logger.warn(f'{mediainfo.title_year} 未搜索到资源')
# 添加订阅
self.subscribechain.add(title=mediainfo.title,
year=mediainfo.year,
mtype=mediainfo.type,
tmdbid=mediainfo.tmdb_id,
season=meta.begin_season,
exist_ok=True,
username="豆瓣想看")
action = "subscribe"
else:
# 自动下载
downloads, lefts = self.downloadchain.batch_download(contexts=contexts, no_exists=no_exists,
username="豆瓣想看")
if downloads and not lefts:
# 全部下载完成
logger.info(f'{mediainfo.title_year} 下载完成')
action = "download"
else:
# 未完成下载
logger.info(f'{mediainfo.title_year} 未下载未完整,添加订阅 ...')
# 添加订阅
self.subscribechain.add(title=mediainfo.title,
year=mediainfo.year,
mtype=mediainfo.type,
tmdbid=mediainfo.tmdb_id,
season=meta.begin_season,
exist_ok=True,
username="豆瓣想看")
action = "subscribe"
# 添加订阅
logger.info(f'{mediainfo.title_year} 媒体库中不存在或不完整,添加订阅 ...')
self.subscribechain.add(title=mediainfo.title,
year=mediainfo.year,
mtype=mediainfo.type,
tmdbid=mediainfo.tmdb_id,
season=meta.begin_season,
exist_ok=True,
username="豆瓣想看")
action = "subscribe"
# 存储历史记录
history.append({
"action": action,

View File

@@ -43,7 +43,7 @@ class SiteStatistic(_PluginBase):
# 插件图标
plugin_icon = "statistic.png"
# 插件版本
plugin_version = "2.5"
plugin_version = "2.6"
# 插件作者
plugin_author = "lightolly"
# 作者主页

View File

@@ -290,8 +290,8 @@ class ISiteUserInfo(metaclass=ABCMeta):
req_headers.update({
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
})
if self._addition_headers:
req_headers.update(self._addition_headers)
if self._addition_headers:
req_headers.update(self._addition_headers)
if self.request_mode == "apikey":
# 使用apikey请求通过请求头传递

View File

@@ -68,7 +68,9 @@ class MTorrentSiteUserInfo(ISiteUserInfo):
domain = StringUtils.get_url_host(self.site_url)
self._torrent_seeding_headers = {
"Content-Type": "application/json",
"Accept": "application/json, text/plain, */*",
"Accept": "application/json, text/plain, */*"
}
self._addition_headers = {
"x-api-key": SystemConfigOper().get(f"site.{domain}.apikey"),
}