nanos / FediFetcher

FediFetcher is a tool for Mastodon that automatically fetches missing replies and posts from other fediverse instances, and adds them to your own Mastodon instance.
https://blog.thms.uk/fedifetcher?utm_source=github
MIT License
296 stars 215 forks source link

Error getting timeline toots: 'next' #3

Closed aeharding closed 1 year ago

aeharding commented 1 year ago

I get the error Error getting timeline toots: 'next' many many times for my instance, https://social.harding.dev.

image image
aeharding commented 1 year ago

I think it's in an infinite loop, so I'm just gonna cancel it

nanos commented 1 year ago

I'm not sure why that would be, but I've put a best-guess fix in, as well as some more error handling and more logging, so at least it shouldn't run an infinite loop anymore.

Can you fetch the latest changes, try again, and let me know the outcome, please?

nanos commented 1 year ago

@aeharding Please make sure you are at least on version 2.0.1. Fixed an important bug there.

(I've also re-written the action, so that future versions shouldn't need you to update your fork, as the action now downloads the latest version automatically for every run.)

aeharding commented 1 year ago

Hi, thanks, it is no longer infinite-looping.

I think the problem is that my home timeline is empty for the admin user of my Mastodon instance.

As a best practice, my main account on my Mastodon "single-user" instance is not an admin, and the admin of my mastodon instance has no followers/followings.

Is it possible to create an environment variable to configure what timeline for what user to use for scraping?

For example, TIMELINE_USER=myusername

It could default to the user that the access token is provided by.

nanos commented 1 year ago

I think the problem is that my home timeline is empty for the admin user of my Mastodon instance.

i thought that would be the reason, but wasn’t sure. Thanks for confirming.

Is it possible to create an environment variable to configure what timeline for what user to use for scraping?

Unfortunately I don’t think so. This script is using the /api/v1/timelines/home endpoint, which doesn’t accept a user ID parameter, but simply returns the home timeline of the authenticated user.

I’ll have another look if I can find an endpoint that would accept a user ID, but i doubt it.

aeharding commented 1 year ago

No problem! You can close this if you want, now that this is cleared up.

nanos commented 1 year ago

Yeah, I’ve just had a look, and unfortunately there is no way to get another user's home timeline. Sorry.

nanos commented 1 year ago

I don’t know if this is still relevant @aeharding , but I built this today for another purpose:

https://getauth.thms.uk/

you should be able to supply an OAuth token as drop in replacement for the access token. That should then work to pull in replies from the home timeline of any arbitrary user.