Traceback (most recent call last): File "vtt-to-srt.py", line 127, in <module> main() File "vtt-to-srt.py", line 125, in main walktree(TopMostPath, convertVTTtoSRT) File "vtt-to-srt.py", line 104, in walktree callback(pathname) File "vtt-to-srt.py", line 117, in convertVTTtoSRT vtt_to_srt(file) File "vtt-to-srt.py", line 82, in vtt_to_srt fileCreate(strNamaFile, strData) File "vtt-to-srt.py", line 46, in fileCreate f.writelines(str(strData)) File "C:\Program Files\Python35\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0: character maps to <undefined>
line 62 needs to be:
Taken from https://stackoverflow.com/questions/9233027/unicodedecodeerror-charmap-codec-cant-decode-byte-x-in-position-y-character
otherwise it fails with:
Traceback (most recent call last): File "vtt-to-srt.py", line 127, in <module> main() File "vtt-to-srt.py", line 125, in main walktree(TopMostPath, convertVTTtoSRT) File "vtt-to-srt.py", line 104, in walktree callback(pathname) File "vtt-to-srt.py", line 117, in convertVTTtoSRT vtt_to_srt(file) File "vtt-to-srt.py", line 82, in vtt_to_srt fileCreate(strNamaFile, strData) File "vtt-to-srt.py", line 46, in fileCreate f.writelines(str(strData)) File "C:\Program Files\Python35\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0: character maps to <undefined>