Force UTF8 encoding for saved subtitles

This commit is contained in:
Louis Vézina 2017-11-29 06:43:19 -05:00
parent 327abd6a0f
commit a6197a09f2

View file

@ -17,7 +17,7 @@ def download_subtitle(path, language, hi, providers):
try:
best_subtitle = best_subtitles[video][0]
result = save_subtitles(video, [best_subtitle])
result = save_subtitles(video, [best_subtitle], encoding='utf-8')
downloaded_provider = str(result[0]).strip('<>').split(' ')[0][:-8]
downloaded_language = pycountry.languages.lookup(str(str(result[0]).strip('<>').split(' ')[2].strip('[]'))).name
message = downloaded_language + " subtitles downloaded from " + downloaded_provider + "."