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
293 stars 213 forks source link

Syntax error after first run attempt #93

Closed MagicLike closed 4 months ago

MagicLike commented 5 months ago

After trying to run FediFetcher for the first time I get the following (weird) syntax error:

File "find_posts.py", line 45
    notifications = get_paginated_mastodon(f"https://{server}/api/v1/notifications", since, headers={
                                                                                  ^
SyntaxError: invalid syntax
nanos commented 5 months ago

That is very strange. How are you trying to run it? Docker, GH Action? On your own hardware?

MagicLike commented 5 months ago

I am trying to run it on my VPS directly

nanos commented 5 months ago

And which version of python are you having installed (python -V / python3 -V)?

MagicLike commented 5 months ago

v3.9.2

nanos commented 4 months ago

In that case I'm afraid I'm out of ideas. Have you had a look at the line in its entirety to ensure you haven't accidentally edited it?

MagicLike commented 4 months ago

In that case I'm afraid I'm out of ideas. Have you had a look at the line in its entirety to ensure you haven't accidentally edited it?

I left it as is and re-downloaded FediFetcher twice, so I am pretty sure I did not change anything... - Are there any other deps I should consider checking?

nanos commented 4 months ago

Are there any other deps I should consider checking? No. Other than running pip install, but failing to run that should lead to a very different error message.

Can you please provide the following:

Obviously obscure the API key please.

MagicLike commented 4 months ago

The full command you run

python find_posts.py -c=./artifacts/config.json

The contents of your config file

{
  "access-token": "*",
  "server": "*.*.*",
  "home-timeline-length": 200,
  "max-followings": 80,
  "from-notifications": 1,
  "max-favourites": 40
}

The full output

This is the full output:

File "find_posts.py", line 45
    notifications = get_paginated_mastodon(f"https://{server}/api/v1/notifications", since, headers={
                                                                                  ^
SyntaxError: invalid syntax
nanos commented 4 months ago

In that case I'm totally stumped.

Only things I can think of:

MagicLike commented 4 months ago

In that case I'm totally stumped.

Only things I can think of:

* are you really really really sure that the python that's executing the `find_posts.py` script is v3?

* Do you have a quotation mark in your `"server"` value?

Okay, so I ran the command again with python3 instead of just python and it now magically works :facepalm:

nanos commented 4 months ago

I asspython is probably an old version. glad to you got it to work!

ToadKing commented 4 months ago

Yeah, on some systems python uses Python 2 instead of 3.