Fix emoji encoding

This commit is contained in:
taizan-hokouto
2020-11-06 19:56:54 +09:00
parent 6c9e327e36
commit d40720616b

View File

@@ -132,7 +132,7 @@ class HTMLArchiver(ChatProcessor):
return standard_b64encode(resp.content).decode() return standard_b64encode(resp.content).decode()
def _set_emoji_table(self, item: dict): def _set_emoji_table(self, item: dict):
emoji_id = item['id'] emoji_id = ''.join(('Z', item['id'])) if 48 <= ord(item['id'][0]) <= 57 else item['id']
if emoji_id not in self.emoji_table: if emoji_id not in self.emoji_table:
self.emoji_table.setdefault(emoji_id, self.executor.submit(self._encode_img, item['url'])) self.emoji_table.setdefault(emoji_id, self.executor.submit(self._encode_img, item['url']))
return emoji_id return emoji_id