Fixed crashes when trying to open YouTube videos with emojis

This commit is contained in:
Bobo 2020-06-22 21:25:51 +03:00
parent b71f076bbb
commit 416e553dfa

View File

@ -1,6 +1,7 @@
import os.path import os.path
import re import re
import string
import time import time
import threading import threading
import _thread import _thread
@ -91,7 +92,7 @@ class MpcHcApi:
cmessage = __OSDDATASTRUCT() cmessage = __OSDDATASTRUCT()
cmessage.nMsgPos = MsgPos cmessage.nMsgPos = MsgPos
cmessage.nDurationMS = DurationMs cmessage.nDurationMS = DurationMs
cmessage.strMsg = message cmessage.strMsg = ''.join(filter(lambda x: x in string.printable, message))
self.__listener.SendCommand(self.CMD_OSDSHOWMESSAGE, cmessage) self.__listener.SendCommand(self.CMD_OSDSHOWMESSAGE, cmessage)
def sendRawCommand(self, cmd, value): def sendRawCommand(self, cmd, value):