mmguero / cleanvid

cleanvid is a little script to mute profanity in video files
BSD 3-Clause "New" or "Revised" License
56 stars 6 forks source link

Error when running #3

Closed PetrusVermaak closed 4 years ago

PetrusVermaak commented 4 years ago

I get this error when running the cmd: File "C:\Program Files\Python38\lib\codecs.py", line 504, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 0: invalid start byte

my cmd: cleanvid.py -s tls.srt -i tls.mp4 -o tlsc.mp4 -w swears.txt

I have Python 3.8 64bit installed.

PetrusVermaak commented 4 years ago

C:\Portable\cleanvid>cleanvid.py -s tls.srt -i tls.mp4 -o tlsc.mkv -w swears.txt Traceback (most recent call last): File "C:\Portable\cleanvid\cleanvid.py", line 150, in cleaner.CreateCleanSubAndMuteList(cleanSubsFileSpec=args.subsOut) File "C:\Portable\cleanvid\cleanvid.py", line 91, in CreateCleanSubAndMuteList subs = pysrt.open(self.inputSubsFileSpec) File "C:\Portable\cleanvid\pysrt\srtfile.py", line 153, in open new_file.read(source_file, error_handling=error_handling) File "C:\Portable\cleanvid\pysrt\srtfile.py", line 181, in read self.extend(self.stream(source_file, error_handling=error_handling)) File "C:\Program Files\Python38\lib\collections__init__.py", line 1130, in extend self.data.extend(other) File "C:\Portable\cleanvid\pysrt\srtfile.py", line 204, in stream for index, line in enumerate(chain(source_file, '\n')): File "C:\Program Files\Python38\lib\codecs.py", line 714, in next return next(self.reader) File "C:\Program Files\Python38\lib\codecs.py", line 645, in next line = self.readline() File "C:\Program Files\Python38\lib\codecs.py", line 558, in readline data = self.read(readsize, firstline=True) File "C:\Program Files\Python38\lib\codecs.py", line 504, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 0: invalid start byte

mmguero commented 4 years ago

Has to do with the file encoding and/or line endings. I need to make a procdure normalize the sub files before we use them.

mmguero commented 4 years ago

Try that fix, I think that should take care of it.

vendova commented 2 years ago

What should i do

PS C:\Users\Kodi\PycharmProjects\cleanvid> cleanvid -s E:\Arcane\WHIPLASH\Whiplas.srt -i E:\Arcane\WHIPLASH\Whiplash.mkv -o E:\Arcane\WHIPLASH\Whiplaskh.mkv -w swears.txt Traceback (most recent call last): File "C:\Users\Kodi\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Kodi\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\Kodi\AppData\Local\Programs\Python\Python310\Scripts\cleanvid.exe__main.py", line 7, in File "C:\Users\Kodi\AppData\Local\Programs\Python\Python310\lib\site-packages\cleanvid\cleanvid.py", line 494, in RunCleanvid cleaner = VidCleaner( File "C:\Users\Kodi\AppData\Local\Programs\Python\Python310\lib\site-packages\cleanvid\cleanvid.py", line 183, in init__ raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), iSwearsFileSpec) FileNotFoundError: [Errno 2] No such file or directory: 'swears.txt'