Skip to content

Commit

Permalink
v1.9.22
Browse files Browse the repository at this point in the history
* 支持rclone网盘整理
* 手动搜索下载支持选择下载路径
* 消息通知支持PushPlus
* 修复刷流使用TR时统计数据错误的问题
  • Loading branch information
jxxghp committed Aug 16, 2022
1 parent 12171a9 commit 45348b7
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 28 deletions.
16 changes: 8 additions & 8 deletions pt/brushtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,16 @@ def remove_tasks_torrents(self):
date_done = torrent.date_done if torrent.date_done else torrent.date_added
dltime = (datetime.now().astimezone() - torrent.date_added).seconds
seeding_time = (datetime.now().astimezone() - date_done).seconds
# 下载量
downloaded = int(torrent.total_size * torrent.progress / 100)
total_downloaded += downloaded
# 分享率
ratio = torrent.ratio or 0
# 上传量
uploaded = int(torrent.total_size * torrent.ratio)
uploaded = int(downloaded * torrent.ratio)
total_uploaded += uploaded
# 平均上传速度
avg_upspeed = int(uploaded / dltime)
# 下载量
downloaded = int(torrent.total_size * torrent.progress)
total_downloaded += downloaded
if self.__check_remove_rule(remove_rule=remove_rule,
seeding_time=seeding_time,
ratio=ratio,
Expand All @@ -305,14 +305,14 @@ def remove_tasks_torrents(self):
torrent_id = torrent.id
# 下载耗时
dltime = (datetime.now().astimezone() - torrent.date_added).seconds
# 下载量
downloaded = int(torrent.total_size * torrent.progress / 100)
total_downloaded += downloaded
# 上传量
uploaded = int(torrent.total_size * torrent.ratio)
uploaded = int(downloaded * torrent.ratio)
total_uploaded += uploaded
# 平均上传速度
avg_upspeed = int(uploaded / dltime)
# 下载量
downloaded = int(torrent.total_size * torrent.progress)
total_downloaded += downloaded
if self.__check_remove_rule(remove_rule=remove_rule,
dltime=dltime,
avg_upspeed=avg_upspeed):
Expand Down
7 changes: 3 additions & 4 deletions rmt/filetransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,13 @@ def __transfer_file(self, file_item, new_file, rmt_mode, over_flag=False):
:param over_flag: 是否覆盖,为True时会先删除再转移
"""
file_name = os.path.basename(file_item)
new_file_name = os.path.basename(new_file)
if not over_flag and os.path.exists(new_file):
log.warn("【RMT】文件已存在:%s" % new_file_name)
log.warn("【RMT】文件已存在:%s" % new_file)
return 0
if over_flag and os.path.isfile(new_file):
log.info("【RMT】正在删除已存在的文件:%s" % new_file_name)
log.info("【RMT】正在删除已存在的文件:%s" % new_file)
os.remove(new_file)
log.info("【RMT】正在转移文件:%s 到 %s" % (file_name, new_file_name))
log.info("【RMT】正在转移文件:%s 到 %s" % (file_name, new_file))
retcode = self.__transfer_command(file_item=file_item,
target_file=new_file,
rmt_mode=rmt_mode)
Expand Down
10 changes: 5 additions & 5 deletions rmt/meta/metaanime.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def __init__(self, title, subtitle=None):
if isinstance(self.audio_encode, list):
self.audio_encode = self.audio_encode[0]
# 解析副标题,只要季和集
self.init_subtitle(title)
if not self._subtitle_flag and subtitle:
self.init_subtitle(subtitle)
self.init_subtitle(self.org_string)
if not self._subtitle_flag and self.subtitle:
self.init_subtitle(self.subtitle)
if not self.type:
self.type = MediaType.TV
except Exception as e:
Expand All @@ -142,8 +142,8 @@ def __prepare_title(title):
if not title:
return title
title = title.replace("【", "[").replace("】", "]").strip()
if re.search(r"新番|月?番|[国日]漫", title):
title = re.sub(".*番.|.*[国日]漫.", "", title)
if re.search(r"新番|月?番|[日美国]漫", title):
title = re.sub(".*番.|.*[日美国]漫.", "", title)
else:
title = re.sub(r"^[^]】]*[]】]", "", title).strip()
title = re.sub(r"\[TV\s+(\d{1,4})", r"[\1", title, flags=re.IGNORECASE)
Expand Down
6 changes: 3 additions & 3 deletions rmt/meta/metavideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def __init__(self, title, subtitle=None):
token = tokens.get_next()
self._continue_flag = True
# 解析副标题,只要季和集
self.init_subtitle(title)
if not self._subtitle_flag and subtitle:
self.init_subtitle(subtitle)
self.init_subtitle(self.org_string)
if not self._subtitle_flag and self.subtitle:
self.init_subtitle(self.subtitle)
# 没有识别出类型时默认为电影
if not self.type:
self.type = MediaType.MOVIE
Expand Down
16 changes: 16 additions & 0 deletions tests/cases/meta_cases.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
meta_cases = [{
"title": "[GM-Team][国漫][斗破苍穹 第5季][Fights Break Sphere V][2022][05][HEVC][GB][4K]",
"subtitle": "",
"target": {
"type": "电视剧",
"cn_name": "",
"en_name": "Fights Break Sphere V",
"year": "2022",
"part": "",
"season": "S05",
"episode": "E05",
"restype": "",
"pix": "",
"video_codec": "HEVC",
"audio_codec": ""
}
}, {
"title": "Ousama Ranking S01E02-[1080p][BDRIP][x265.FLAC].mkv",
"subtitle": "",
"target": {
Expand Down
14 changes: 7 additions & 7 deletions utils/check_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,21 @@ def check_config(config):
# 检查PT配置
if config.get_config('pt'):
pt_client = config.get_config('pt').get('pt_client')
log.info("PT下载软件设置为:%s" % pt_client)
log.info("下载软件设置为:%s" % pt_client)

rmt_mode = config.get_config('pt').get('rmt_mode', 'copy')
if rmt_mode == "link":
log.info("PT下载文件转移模式为:硬链接")
log.info("下载文件转移模式为:硬链接")
elif rmt_mode == "softlink":
log.info("PT下载文件转移模式为:软链接")
log.info("下载文件转移模式为:软链接")
elif rmt_mode == "move":
log.info("PT下载文件转移模式为:移动")
log.info("下载文件转移模式为:移动")
elif rmt_mode == "rclone":
log.info("PT下载文件转移模式为:rclone移动")
log.info("下载文件转移模式为:rclone移动")
elif rmt_mode == "rclonecopy":
log.info("PT下载文件转移模式为:rclone复制")
log.info("下载文件转移模式为:rclone复制")
else:
log.info("PT下载文件转移模式为:复制")
log.info("下载文件转移模式为:复制")

search_indexer = config.get_config('pt').get('search_indexer')
if search_indexer:
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APP_VERSION = 'v1.9.21'
APP_VERSION = 'v1.9.22'

0 comments on commit 45348b7

Please sign in to comment.