diff --git a/dump-html.py b/dump-html.py index 0567cbc..4a721fa 100755 --- a/dump-html.py +++ b/dump-html.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: UTF-8 -*- - +import os import sys import argparse import logging @@ -46,6 +46,7 @@ if __name__ == '__main__': render = HTMLRender(parser, res) htmls = render.render_msgs(msgs) + os.makedirs(os.path.dirname(output_file), exist_ok=True) if len(htmls) == 1: with open(output_file, 'w') as f: f.write(htmls[0]) diff --git a/wechat/parser.py b/wechat/parser.py index 96e8560..89eaa42 100644 --- a/wechat/parser.py +++ b/wechat/parser.py @@ -32,7 +32,6 @@ class WeChatDBParser(object): self.msgs_by_chat = defaultdict(list) self.emoji_groups = {} self.emoji_info = {} - self.internal_emojis = {} self.emoji_encryption_key = None self._parse() diff --git a/wechat/res.py b/wechat/res.py index 2bb6429..d70c486 100644 --- a/wechat/res.py +++ b/wechat/res.py @@ -50,7 +50,7 @@ class Resource(object): ret = os.path.join(self.voice_dir, dir1, dir2, 'msg_{}.amr'.format(imgpath)) if not os.path.isfile(ret): - logger.error("Voice file not found for {}".format(imgpath)) + logger.error(f"Cannot find voice file {imgpath}, {fname}") return "" return ret @@ -77,7 +77,7 @@ class Resource(object): """ return base64 unicode string""" im = self.avt_reader.get_avatar(username) if im is None: - logger.warning(f"Avatar for {username} is missing.") + logger.warning(f"Cannot find avatar for {username}.") return "" buf = io.BytesIO() try: @@ -165,5 +165,5 @@ class Resource(object): return video_file elif os.path.exists(video_thumbnail_file): return video_thumbnail_file - logger.warning(f"Cannot get video {videoid}") + logger.warning(f"Cannot find video {videoid}") return "" diff --git a/wechat/static/internal_emoji/dice_1.png b/wechat/static/internal_emoji/dice_1.png deleted file mode 100644 index a1b0263..0000000 Binary files a/wechat/static/internal_emoji/dice_1.png and /dev/null differ diff --git a/wechat/static/internal_emoji/dice_2.png b/wechat/static/internal_emoji/dice_2.png deleted file mode 100644 index 682e0d5..0000000 Binary files a/wechat/static/internal_emoji/dice_2.png and /dev/null differ diff --git a/wechat/static/internal_emoji/dice_3.png b/wechat/static/internal_emoji/dice_3.png deleted file mode 100644 index 2ed92d5..0000000 Binary files a/wechat/static/internal_emoji/dice_3.png and /dev/null differ diff --git a/wechat/static/internal_emoji/dice_4.png b/wechat/static/internal_emoji/dice_4.png deleted file mode 100644 index 53e0514..0000000 Binary files a/wechat/static/internal_emoji/dice_4.png and /dev/null differ diff --git a/wechat/static/internal_emoji/dice_5.png b/wechat/static/internal_emoji/dice_5.png deleted file mode 100644 index 3e58435..0000000 Binary files a/wechat/static/internal_emoji/dice_5.png and /dev/null differ diff --git a/wechat/static/internal_emoji/dice_6.png b/wechat/static/internal_emoji/dice_6.png deleted file mode 100644 index 1660f85..0000000 Binary files a/wechat/static/internal_emoji/dice_6.png and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_002.gif b/wechat/static/internal_emoji/icon_002.gif deleted file mode 100644 index 5b0bc67..0000000 Binary files a/wechat/static/internal_emoji/icon_002.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_007.gif b/wechat/static/internal_emoji/icon_007.gif deleted file mode 100644 index 1bf6125..0000000 Binary files a/wechat/static/internal_emoji/icon_007.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_010.gif b/wechat/static/internal_emoji/icon_010.gif deleted file mode 100644 index 505f27b..0000000 Binary files a/wechat/static/internal_emoji/icon_010.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_012.gif b/wechat/static/internal_emoji/icon_012.gif deleted file mode 100644 index e36acbd..0000000 Binary files a/wechat/static/internal_emoji/icon_012.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_013.gif b/wechat/static/internal_emoji/icon_013.gif deleted file mode 100644 index 69c07e5..0000000 Binary files a/wechat/static/internal_emoji/icon_013.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_018.gif b/wechat/static/internal_emoji/icon_018.gif deleted file mode 100644 index 35888d7..0000000 Binary files a/wechat/static/internal_emoji/icon_018.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_019.gif b/wechat/static/internal_emoji/icon_019.gif deleted file mode 100644 index f773250..0000000 Binary files a/wechat/static/internal_emoji/icon_019.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_020.gif b/wechat/static/internal_emoji/icon_020.gif deleted file mode 100644 index 3b0df8a..0000000 Binary files a/wechat/static/internal_emoji/icon_020.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_021.gif b/wechat/static/internal_emoji/icon_021.gif deleted file mode 100644 index d186f3f..0000000 Binary files a/wechat/static/internal_emoji/icon_021.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_022.gif b/wechat/static/internal_emoji/icon_022.gif deleted file mode 100644 index 56be650..0000000 Binary files a/wechat/static/internal_emoji/icon_022.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_024.gif b/wechat/static/internal_emoji/icon_024.gif deleted file mode 100644 index aaccb00..0000000 Binary files a/wechat/static/internal_emoji/icon_024.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_027.gif b/wechat/static/internal_emoji/icon_027.gif deleted file mode 100644 index 7784a5d..0000000 Binary files a/wechat/static/internal_emoji/icon_027.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_029.gif b/wechat/static/internal_emoji/icon_029.gif deleted file mode 100644 index 519949b..0000000 Binary files a/wechat/static/internal_emoji/icon_029.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_030.gif b/wechat/static/internal_emoji/icon_030.gif deleted file mode 100644 index df7f487..0000000 Binary files a/wechat/static/internal_emoji/icon_030.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_035.gif b/wechat/static/internal_emoji/icon_035.gif deleted file mode 100644 index be7a910..0000000 Binary files a/wechat/static/internal_emoji/icon_035.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/icon_040.gif b/wechat/static/internal_emoji/icon_040.gif deleted file mode 100644 index 5a2d69e..0000000 Binary files a/wechat/static/internal_emoji/icon_040.gif and /dev/null differ diff --git a/wechat/static/internal_emoji/jsb_b.png b/wechat/static/internal_emoji/jsb_b.png deleted file mode 100644 index 7ddfb39..0000000 Binary files a/wechat/static/internal_emoji/jsb_b.png and /dev/null differ diff --git a/wechat/static/internal_emoji/jsb_j.png b/wechat/static/internal_emoji/jsb_j.png deleted file mode 100644 index 36e963f..0000000 Binary files a/wechat/static/internal_emoji/jsb_j.png and /dev/null differ diff --git a/wechat/static/internal_emoji/jsb_s.png b/wechat/static/internal_emoji/jsb_s.png deleted file mode 100644 index d932cef..0000000 Binary files a/wechat/static/internal_emoji/jsb_s.png and /dev/null differ