Linus2punkt0 / bluesky-crossposter

An app for crossposting your posts from bluesky to twitter and mastodon
108 stars 23 forks source link

Posts referencing feeds throw an error #9

Closed ineffyble closed 1 year ago

ineffyble commented 1 year ago

Trying to set up the crossposter and getting this when I run:

Traceback (most recent call last):
  File "/home/bluesky-crossposter/ineffyble/crosspost.py", line 458, in <module>
    posts = getPosts()
  File "/home/bluesky-crossposter/ineffyble/crosspost.py", line 66, in getPosts
    replyToUser, replyTo = getQuotePost(feed_view.post.embed.record)
  File "/home/bluesky-crossposter/ineffyble/crosspost.py", line 154, in getQuotePost
    user = post.record.author.handle
AttributeError: 'GeneratorView' object has no attribute 'record'

I added a debug print and worked out it's failing when it runs into this post: https://bsky.app/profile/effy.space/post/3k27n2vvox52o

It seems like a post that references a feed looks like a quote post but doesn't act the same way.

I'll add a line locally to ignore the issue for now.

Linus2punkt0 commented 1 year ago

I added a try-block when getting quote post info that will skip the post if it fails. It seemed like the easiest way to determine if the post was a link to a feed, and I don't believe people want to crosspost that anyway. I might be wrong though, and if I am, I'll write a fix!