Change the way to reading movie types and sub types to config file
This commit is contained in:
@@ -48,7 +48,7 @@ uncensored_prefix=S2M,BT,LAF,SMD
|
|||||||
|
|
||||||
[media]
|
[media]
|
||||||
; 影片后缀
|
; 影片后缀
|
||||||
media_type=.mp4,.avi,.rmvb,.wmv,.mov,.mkv,.flv,.ts,.webm,.MP4,.AVI,.RMVB,.WMV,.MOV,.MKV,.FLV,.TS,.WEBM,iso,ISO
|
media_type=.mp4,.avi,.rmvb,.wmv,.mov,.mkv,.flv,.ts,.webm,.iso
|
||||||
; 字幕后缀
|
; 字幕后缀
|
||||||
sub_type=.smi,.srt,.idx,.sub,.sup,.psb,.ssa,.ass,.txt,.usf,.xss,.ssf,.rt,.lrc,.sbv,.vtt,.ttml
|
sub_type=.smi,.srt,.idx,.sub,.sup,.psb,.ssa,.ass,.txt,.usf,.xss,.ssf,.rt,.lrc,.sbv,.vtt,.ttml
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class Config:
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
self._exit("common")
|
self._exit("common")
|
||||||
|
|
||||||
def media_rule(self) -> str:
|
def media_type(self) -> str:
|
||||||
return self.conf.get('media', 'media_type').replace(',', '|')
|
return self.conf.get('media', 'media_type').replace(',', '|')
|
||||||
|
|
||||||
def sub_rule(self):
|
def sub_rule(self):
|
||||||
|
|||||||
4
core.py
4
core.py
@@ -572,8 +572,8 @@ def paste_file_to_folder(filepath, path, number, c_word, conf: config.Config):
|
|||||||
sub_res = conf.sub_rule()
|
sub_res = conf.sub_rule()
|
||||||
|
|
||||||
for subname in sub_res:
|
for subname in sub_res:
|
||||||
if os.path.exists(os.getcwd() + '/' + number + c_word + subname): # 字幕移动
|
if os.path.exists(number + c_word + subname): # 字幕移动
|
||||||
os.rename(os.getcwd() + '/' + number + c_word + subname, path + '/' + number + c_word + subname)
|
os.rename(number + c_word + subname, path + '/' + number + c_word + subname)
|
||||||
print('[+]Sub moved!')
|
print('[+]Sub moved!')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user