emericg / OpenSubtitlesDownload

Automatically find and download the right subtitles for your favorite videos!
https://emeric.io/OpenSubtitlesDownload
GNU General Public License v3.0
579 stars 63 forks source link

Unexpected error (line 862): <class 'UnicodeEncodeError'> #96

Closed danzig666 closed 6 months ago

danzig666 commented 1 year ago

UnicodeEncodeError, command line was: python OpenSubtitlesDownload.py -u user -p pass --cli -l hun -8 c:\path\ -a -i -x

Quick fix: byteswritten = open(subPath, 'w', encoding='utf-8').write(decodedStr)

emericg commented 6 months ago

The v6 version with the new opensubtitles.com always download subtitles in UTF8 encoded format, and the code you mention is not in the script anymore.

Feel free to reopen an issue if similar problems (related to subtitles encoding) are found with the new provider.