@@ -0,0 +1,1657 @@
+import os%0Aimport sys%0A%0A%0Adef main():%0A    if len(sys.argv) != 2:%0A        print(%22Usage: Pass the file name for the source transcript txt file.%22)%0A        sys.exit(-1)%0A%0A    file = sys.argv%5B1%5D%0A    out_file = os.path.expanduser(%0A        os.path.join(%0A            '~/Desktop',%0A            os.path.basename(file)%0A        )%0A    )%0A    print(%22Files:%22)%0A    print(%22Reading source file: %22, file)%0A    print(%22Exported version at: %22, out_file)%0A%0A    fin = open(file, 'r', encoding='utf-8')%0A    fout = open(out_file, 'w', encoding='utf-8')%0A%0A    with fin, fout:%0A        time = %220:00%22%0A        for line in fin:%0A            if is_time(line):%0A                time = get_time_text(line)%0A            elif line and line.strip():%0A                text = f%22%7Btime%7D %7Bline.strip()%7D%5Cn%5Cn%22%0A                fout.write(text)%0A                # print(text)%0A%0A%0Adef is_time(line: str) -%3E bool:%0A    if not line or not line.strip():%0A        return False%0A%0A    parts = line.split(':')%0A    if not parts:%0A        return False%0A%0A    return all(p.strip().isnumeric() for p in parts)%0A%0A%0Adef get_time_text(line: str) -%3E str:%0A    if ':' not in line:%0A        raise Exception(f%22Text doesn't seem to be a time: %7Bline%7D%22)%0A%0A    parts = line.split(':')%0A%0A    hour_text = %220%22%0A    min_text = %220%22%0A    sec_text = %220%22%0A%0A    if len(parts) == 3:%0A        hour_text = parts%5B0%5D.strip()%0A        min_text = parts%5B1%5D.strip()%0A        sec_text = parts%5B2%5D.strip()%0A    elif len(parts) == 2:%0A        min_text = parts%5B0%5D.strip()%0A        sec_text = parts%5B1%5D.strip()%0A    elif len(parts) == 1:%0A        sec_text = parts%5B0%5D.strip()%0A%0A    return f%22%7Bhour_text.zfill(2)%7D:%7Bmin_text.zfill(2)%7D:%7Bsec_text.zfill(2)%7D%22%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add a tool to convert from otter formats to what we use on the website.