MCPcopy
hub / github.com/alchaincyf/nuwa-skill / clean_vtt

Function clean_vtt

scripts/srt_to_transcript.py:65–71  ·  view source on GitHub ↗

清洗VTT格式字幕(先去掉VTT头部,然后按SRT逻辑处理)

(content: str)

Source from the content-addressed store, hash-verified

63
64
65def clean_vtt(content: str) -> str:
66 """清洗VTT格式字幕(先去掉VTT头部,然后按SRT逻辑处理)"""
67 # 去掉WEBVTT头部
68 content = re.sub(r'^WEBVTT.*?\n\n', '', content, flags=re.DOTALL)
69 # 去掉NOTE块
70 content = re.sub(r'NOTE.*?\n\n', '', content, flags=re.DOTALL)
71 return clean_srt(content)
72
73
74def main():

Callers 1

mainFunction · 0.85

Calls 1

clean_srtFunction · 0.85

Tested by

no test coverage detected