robertoszek / pleroma-bot

Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon/Misskey.
https://robertoszek.github.io/pleroma-bot
MIT License
102 stars 19 forks source link

ERROR: Exception occurred for user #119

Closed CDN18 closed 1 year ago

CDN18 commented 1 year ago

pleroma-bot config (personal information redacted)

pleroma_base_url: https://mastodon.instance
users:
- twitter_username: username
  pleroma_username: 1********************0
  pleroma_token: d****************************
  rss: https://my.nitter.instance/username/with_replies/rss

Error message

2023-01-28 16:58:17,660 pleroma_bot ERROR: Exception occurred for user, skipping...
Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/pleroma_bot/cli.py", line 556, in main
    user = User(user_item, config, base_path, posts_ids)
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/pleroma_bot/cli.py", line 289, in __init__
    self.mastodon_enforce_limits()
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/pleroma_bot/_utils.py", line 547, in mastodon_enforce_limits
    if len(self.display_name[t_user]) > 30:
KeyError: 'username'

The twitter username is 13 characters long.

robertoszek commented 1 year ago

Hi! Which version are you on, v1.2.0? I think there's a bug on the Mastodon limits logic when using RSS feeds.

If it's what I'm thinking it should be resolved on the release candidate version 1.2.1rc18, which you can install like so:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pleroma-bot==1.2.1rc18

If that's the issue, the fix should be rolled into the next stable release too.

CDN18 commented 1 year ago

Yes I'm on v1.2.0, sorry I forgot to mention this before. After upgrading to v1.2.1rc18, the above issue was resolved but the bot throws a new error while posting tweets:

Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/pleroma_bot/cli.py", line 699, in main
    cw=tweet["cw"]
KeyError: 'cw'
robertoszek commented 1 year ago

Oh, interesting.

Does 1.2.1rc19 solve it?:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pleroma-bot==1.2.1rc19
CDN18 commented 1 year ago

Yes, in 1.2.1rc19 the bot can repost the tweets successfully, many thanks❤️