fix: Fix logging issue and convert status ID to string TUN-45

This commit is contained in:
Ching 2024-04-04 14:14:07 +08:00
parent ab4ba9b75c
commit ac02e46203

View File

@ -165,11 +165,11 @@ def run(instance, access_token, fanfou_cookie, fanfou_token):
if str(status['id']) not in posted_ids:
content = status['content'].replace('<br />', '\n')
content = re.sub('<.*?>', '', content)
logger.info(status['id'] + ' ' + content)
logger.info(str(status['id']) + ' ' + content)
post_fanfou(fanfou_cookie, fanfou_token, content, status['media_attachments'])
with open(last_id_file, 'a') as f:
f.write(str(status['id']) + '\n')
posted_ids.append(status['id'])
posted_ids.append(str(status['id']))
logger.info('write toot %s', status['content'])
time.sleep(10)
# update min_id