MCPcopy Create free account
hub / github.com/Cicada000/VV / parse_timestamp

Method parse_timestamp

CutSubtitle.py:27–33  ·  view source on GitHub ↗

将时间戳 (如 "2m28s") 转换为总秒数

(self, timestamp)

Source from the content-addressed store, hash-verified

25 self.subtitles_dict = defaultdict(list)
26
27 def parse_timestamp(self, timestamp):
28 """将时间戳 (如 "2m28s") 转换为总秒数"""
29 match = re.match(r'(\d+)m(\d+)s', timestamp)
30 if match:
31 minutes, seconds = map(int, match.groups())
32 return minutes * 60 + seconds
33 return 0
34
35 def process_image(self, img_path):
36 """处理单个图像并提取文字"""

Callers 1

process_framesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected