优化字幕检测
This commit is contained in:
@@ -3,6 +3,7 @@ import re
|
||||
import sys
|
||||
import configparser
|
||||
import time
|
||||
import typing
|
||||
from pathlib import Path
|
||||
|
||||
G_conf_override = {
|
||||
@@ -263,8 +264,8 @@ class Config:
|
||||
def media_type(self) -> str:
|
||||
return self.conf.get('media', 'media_type')
|
||||
|
||||
def sub_rule(self):
|
||||
return self.conf.get('media', 'sub_type').split(',')
|
||||
def sub_rule(self) -> typing.Set[str]:
|
||||
return set(self.conf.get('media', 'sub_type').lower().split(','))
|
||||
|
||||
def naming_rule(self) -> str:
|
||||
return self.conf.get("Name_Rule", "naming_rule")
|
||||
@@ -445,9 +446,9 @@ class Config:
|
||||
sec11 = "media"
|
||||
conf.add_section(sec11)
|
||||
conf.set(sec11, "media_type",
|
||||
".mp4,.avi,.rmvb,.wmv,.mov,.mkv,.flv,.ts,.webm,.MP4,.AVI,.RMVB,.WMV,.MOV,.MKV,.FLV,.TS,.WEBM,iso,ISO")
|
||||
".mp4,.avi,.rmvb,.wmv,.mov,.mkv,.flv,.ts,.webm,iso")
|
||||
conf.set(sec11, "sub_type",
|
||||
".smi,.srt,.idx,.sub,.sup,.psb,.ssa,.ass,.txt,.usf,.xss,.ssf,.rt,.lrc,.sbv,.vtt,.ttml")
|
||||
".smi,.srt,.idx,.sub,.sup,.psb,.ssa,.ass,.usf,.xss,.ssf,.rt,.lrc,.sbv,.vtt,.ttml")
|
||||
|
||||
sec12 = "watermark"
|
||||
conf.add_section(sec12)
|
||||
|
||||
4
core.py
4
core.py
@@ -521,7 +521,7 @@ def paste_file_to_folder(filepath, path, multi_part, number, part, leak_word, c_
|
||||
except:
|
||||
os.symlink(str(filepath_obj.resolve()), targetpath)
|
||||
|
||||
sub_res = [subext.lower() for subext in config.getInstance().sub_rule()]
|
||||
sub_res = config.getInstance().sub_rule()
|
||||
for subfile in filepath_obj.parent.glob('**/*'):
|
||||
if subfile.is_file() and subfile.suffix.lower() in sub_res:
|
||||
if multi_part and part.lower() not in subfile.name.lower():
|
||||
@@ -572,7 +572,7 @@ def paste_file_to_folder_mode2(filepath, path, multi_part, number, part, leak_wo
|
||||
except:
|
||||
os.symlink(str(filepath_obj.resolve()), targetpath)
|
||||
|
||||
sub_res = [subext.lower() for subext in config.getInstance().sub_rule()]
|
||||
sub_res = config.getInstance().sub_rule()
|
||||
for subfile in filepath_obj.parent.glob('**/*'):
|
||||
if subfile.is_file() and subfile.suffix.lower() in sub_res:
|
||||
if multi_part and part.lower() not in subfile.name.lower():
|
||||
|
||||
Reference in New Issue
Block a user