Skip to content

Commit 6faac54

Browse files
committed
new method to get subtitle name in ASFMKV function
1 parent cd69cb4 commit 6faac54

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ASFMKV_dev.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ def isExists(fPath: str):
20232023

20242024

20252025
def assFontChange(newfont_name: dict, asspath: str, assInfo: dict, splitEvents: dict[int, list[dict]], outdir: str = '',
2026-
cover: bool = True, embedded: bool = False) -> str:
2026+
cover: bool = False, embedded: bool = False) -> str:
20272027
"""
20282028
更改ASS样式对应的字体
20292029
@@ -2224,7 +2224,8 @@ def ffASFMKV(file: str, outfile: str = '', asslangs: list = [], asspaths: list =
22242224
for i in range(0, len(asspaths)):
22252225
s = asspaths[i]
22262226
assfn = path.splitext(path.basename(s))[0]
2227-
assnote = assfn[(assfn.find(fn) + len(fn)):].replace('.subset', '')
2227+
assnote = assfn[(assfn.find(fn) + len(fn)):]
2228+
assnote = assnote[0:assnote.find('.subset')]
22282229
# print(assfn, fn, assnote)
22292230
metadata = None
22302231
metadata = []
@@ -2324,7 +2325,8 @@ def ASFMKV(file: str, outfile: str = '', asslangs: dict = {}, asspaths: list = [
23242325
for i in range(0, len(asspaths)):
23252326
s = asspaths[i]
23262327
assfn = path.splitext(path.basename(s))[0]
2327-
assnote = assfn[(assfn.find(fn) + len(fn)):].replace('.subset', '')
2328+
assnote = assfn[(assfn.find(fn) + len(fn)):]
2329+
assnote = assnote[0:assnote.find('.subset')]
23282330
# print(assfn, fn, assnote)
23292331
if len(assnote) > 1:
23302332
mkvargs.extend(['--track-name', '0:{0}'.format(assnote.lstrip('.'))])
@@ -3823,7 +3825,7 @@ def cFontSubset(font_info):
38233825

38243826
def cLicense():
38253827
cls()
3826-
print('''AddSubFontMKV Python Remake Preview 22
3828+
print('''AddSubFontMKV Python Remake Preview 23
38273829
38283830
Apache-2.0 License
38293831
https://www.apache.org/licenses/
@@ -4089,7 +4091,7 @@ def checkFF():
40894091
def loadMain(reload: bool = False):
40904092
global extlist, no_mkvm, no_cmdc, dupfont, mkvmv, font_info, fontin, langlist, ffmv, insteadFF
40914093
# 初始化字体列表 和 mkvmerge 相关参数
4092-
os.system('title ASFMKV Python Remake Pre22 ^| (c) 2022-2024 yyfll ^| Apache-2.0')
4094+
os.system('title ASFMKV Python Remake Pre23 ^| (c) 2022-2024 yyfll ^| Apache-2.0')
40934095
if not reload:
40944096
if not o_fontload:
40954097
font_list = getFontFileList(fontin)
@@ -4136,7 +4138,7 @@ def loadMain(reload: bool = False):
41364138
if not len(ffmv) > 0:
41374139
ffMessage = '\n[F] 检查并启用FFmpeg'
41384140
ffSelect = 'F'
4139-
print('''ASFMKV Python Remake Pre22 | (c) 2022-2024 yyfll{0}{5}
4141+
print('''ASFMKV Python Remake Pre23 | (c) 2022-2024 yyfll{0}{5}
41404142
字体名称数: [\033[1;33m{2}\033[0m]({4})
41414143
请选择功能:
41424144
[A] 列出字幕所用字体

0 commit comments

Comments
 (0)