You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elifline.startswith('**'): # error handling if bold format is wrong
73
+
messagebox.showerror("Error", f"Invalid speaker mapping format in line:\n'{line}'.\nUse format like: **SPEAKER_00**: Speaker Name")
74
+
returnNone
75
+
elif':'inline: # basic fallback if no bolding intended but colon exists
76
+
parts=line.split(':', 1)
77
+
speaker_label=parts<source_iddata="0"title="FULL VIDEO: President Donald Trump's meeting with Ukraine President Zelenskyy turns tense [um19Mf4dYes].830cb1e7-78a8-48f8-882c-199035df5869.srt"/>.strip()
78
+
speaker_name=parts[1].strip()
79
+
ifre.match(r'SPEAKER_\d+', speaker_label):
80
+
speaker_map[speaker_label] =speaker_name
81
+
else:
82
+
messagebox.showerror("Error", f"Invalid speaker label format in line: '{line}'. Expected 'SPEAKER_XX:'")
83
+
returnNone
84
+
85
+
86
+
returnspeaker_map
87
+
88
+
defprocess_srt_gui():
89
+
srt_file_path=srt_file_entry.get()
90
+
map_text=speaker_map_text_area.get("1.0", tk.END) # Get text from Text area
91
+
92
+
ifnotos.path.exists(srt_file_path):
93
+
messagebox.showerror("Error", f"SRT file not found: '{srt_file_path}'")
94
+
return
95
+
96
+
custom_map=parse_speaker_map_text(map_text)
97
+
ifcustom_map:
98
+
identify_speakers_srt(srt_file_path, custom_map)
99
+
100
+
101
+
if__name__=="__main__":
102
+
iflen(sys.argv) !=2:
103
+
print("Usage: Identify.py Full_video.srt")
104
+
print(" A GUI will open to paste speaker mappings.")
0 commit comments