暂时修复bug

This commit is contained in:
EstrellaXD
2022-06-03 22:54:51 +08:00
parent 97c4b10d59
commit 65550fc2e1
3 changed files with 21 additions and 18 deletions

View File

@@ -24,7 +24,7 @@ class Renamer:
def rename_normal(self, name):
for rule in self.rules:
matchObj = rule.match(name, re.I)
matchObj = re.match(rule, name, re.I)
if matchObj is not None:
new_name = f"{matchObj.group(1).strip()} E{matchObj.group(2)}{matchObj.group(3)}"
return new_name
@@ -33,7 +33,7 @@ class Renamer:
n = re.split(r"\[|\]", name)
file_name = name.replace(f"[{n[1]}]", "")
for rule in self.rules:
matchObj = rule.match(file_name, re.I)
matchObj = re.match(rule, file_name, re.I)
if matchObj is not None:
new_name = re.sub(
r"\[|\]",
@@ -68,3 +68,8 @@ class Renamer:
except:
logger.warning(f"{name} rename fail")
self.print_result(torrent_count, rename_count)
if __name__ == "__main__":
rename = Renamer()
rename.rename_pn("[Lilith-Raws] Shokei Shoujo no Virgin Road - 02 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4]")

View File

@@ -30,7 +30,12 @@
"爱恋&漫猫字幕组",
"MingY",
"VCB-Studio",
"虹咲学园烤肉同好会",
"虹咲学园烤肉同好会"
],
"name_position": 1
},
{
"group_name": [
"喵萌奶茶屋",
"爱恋字母社",
"诸神字幕组",
@@ -41,21 +46,14 @@
"SweetSub&圆环记录攻略组",
"动漫萌",
"极影字幕社",
"喵萌Production",
"ANi",
"爱恋字母社",
"熔岩字幕",
"熔岩动画",
"c.c动漫",
"霜庭云花Sub"
"喵萌Production"
],
"type": 1
"name_position": 2
},
{
"group_name": [
"澄空学园&华盟字幕社",
"PoInSu"
"爱恋字母社"
],
"type": 2
"name_position": 3
}
]

View File

@@ -12,11 +12,11 @@ logger = logging.getLogger(__name__)
with open("config.json") as f:
server_info = json.load(f)
host_ip = "http://"+server_info['host_ip']
user_name = server_info['username']
password = server_info['password']
host_ip = "192.168.1.18:6363"
user_name = "admin"
password = "adminadmin"
log_name = op.join(op.dirname(op.realpath(__file__)), 'log.txt')
method = server_info['method']
method = "pn"
# Episode Regular Expression Matching Rules
episode_rules = [r'(.*)\[(\d{1,3}|\d{1,3}\.\d{1,2})(?:v\d{1,2})?(?:END)?\](.*)',