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

Twitter archive -> Mastodon fails with "KeyError" #124

Closed BarsMonster closed 1 year ago

BarsMonster commented 1 year ago

After setting up config according to documentation, I am failing to perform the migration with the following error:

  File "/home/px/.local/lib/python3.10/site-packages/pleroma_bot/cli.py", line 556, in main
    user = User(user_item, config, base_path, posts_ids)
  File "/home/px/.local/lib/python3.10/site-packages/pleroma_bot/cli.py", line 289, in __init__
    self.mastodon_enforce_limits()
  File "/home/px/.local/lib/python3.10/site-packages/pleroma_bot/_utils.py", line 547, in mastodon_enforce_limits
    if len(self.display_name[t_user]) > 30:
KeyError: 'zeptobars'

Config file:

pleroma_base_url: https://techhub.social
max_tweets: 10
users:
- twitter_username: zeptobars
  pleroma_username: 109950178622890422
  pleroma_token: [TOKEN_CENSORED]
  signature: false
  archive: twitter.zip
  bio_text: "\U0001F916 BEEP BOOP \U0001F916 \n I'm a bot that mirrors {{ twitter_username }} Twitter's account.\n \n "
  fields:
      - name: "\U0001F426 Birdsite"
        value: "{{ twitter_url }}"
      - name: "Status"
        value: "I am completely operational, and all my circuits are functioning perfectly."
      - name: "WWW"
        value: "{{ website }}"
robertoszek commented 1 year ago

Hi! Could this be the same issue as #119?

Which version are you on? You can check by running:

pleroma-bot --version

The latest release candidate as of now is v1.2.1rc20, 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.1rc20
BarsMonster commented 1 year ago

Yep, looks like that's it (it was also on 1.2.0). RC version fails further on pinned tweets (as I don't have one)... Will investigate. Thanks for quick feedback!