Username (or Mastodon handle) including _ (underscore) throw error
sthierolf opened this issue ยท 7 comments
Thanks for this tool and I would like to report the following error:
Handles including _ (underscore) throw error.
I have 4 bots running containing _ in their names (marked as bots, fetching RSS feeds)
By looking up for this username, I got the following error thrown:
Input username WITHOUT the @ symbol in front!
Username: bot_feed_bvl_warn@odenwald.social
Traceback (most recent call last):
File "/home/toor/Masto/masto.py", line 375, in <module>
main()
File "/home/toor/Masto/masto.py", line 368, in main
mastodon_search()
File "/home/toor/Masto/masto.py", line 156, in mastodon_search
data = json.loads(response.text)
File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Thank you
I forgot to mention this applies to username on mastodon.social.
Hi @sthierolf , thank you for opening up the issue.
When searching for a user, you should not add @odenwald.social
at the end.
You should only search for: bot_feed_bvl_warn
(See screenshot below)
The mastodon API is not fully reliable, and sometimes does not find users who exist.
I am working on a fix for this and to list the most servers that I find and that the mastodon API does not cover.
So probably next week, when you search for the username bot_feed_bvl_warn
, you should get a positive results ๐
@sthierolf:
this is the search you would do for the instance (I cleaned up some code this evening)
@sthierolf : I will now close the issue as it's not an issue with the underscore ๐ , it's how the username is typed, and the instance should not be included when you search for a username.
- example for this user:
@silverfox@chaos.social
- You should search on Masto for:
silverfox
Hi, checked today and it runs (same code version) as expected. I guess a lot depends at the moment on the load of the Mastodon server and how fast the server can respond on it's API.
This is the result of my test now, looks good :)
Input username WITHOUT the @ symbol in front!
Username: bot_feed_bvl_warn
100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 10/10 [00:00<00:00, 33.07it/s]
user [bot_feed_bvl_warn] NOT found!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Find information on instance (server)
Example: social.network.europa.eu
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Input instance (server) name WITHOUT the @ symbol in front!
Instance: odenwald.social
100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 10/10 [00:00<00:00, 33.08it/s]
instance (server): odenwald.social
---cut---
@sthierolf : Very happy that all is now in working order for you!!!
Check next week for the new version which will be even better and stronger