From 5095ca63a802ea9351a77e5407e0fa38fa65f87f Mon Sep 17 00:00:00 2001 From: Ching Date: Mon, 14 Mar 2022 21:11:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(main):=20=E4=BF=AE=E5=A4=8D=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E4=B8=AD=E7=9A=84=20html=20tag=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复链接中的 html tag 没有过滤的问题 Signed-off-by: Ching --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4f4b6c5..1d9115e 100644 --- a/main.py +++ b/main.py @@ -85,7 +85,8 @@ def run(instance, access_token, fanfou_account, fanfou_password): for status in statuses: if not status['reblog'] and status['visibility'] == 'public': if str(status['id']) not in posted_ids: - content = status['content'].replace('

', '').replace('

', '').replace('
', '\n') + content = status['content'].replace('
', '\n') + content = re.sub('<.*?>', '', content) print(status['id'], content) post_fanfou(chrome, content, None) with open('last_id.txt', 'a') as f: