-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling Mastodon stream_user
version check.
#373
Comments
Sigh. I genuinely wish people would stop making up new creative ways of formatting the version string for the API and just put the version of the API that their server software tries to support in there, or use any of the things people already do. I already have like 3 different weird edge cases for pleroma and masto forks, apparently sharkey invented yet another way that I get to put in now ("version": "3.0.0 (compatible; Sharkey 2024.3.1)") anyways: set "version_check_mode" to "none" (string "none", lowercase) in the constructor, that should hopefully mostly work. Some functions that disambiguate by version may not work (mostly search), use the _v1 or _v2 variants of those explicitly. |
thank you! ❤️ Also for reporting streaming API errors should I refer to the Sharkey devs or here (in the issue tracker)?
|
Ah, hm. Maybe Sharkey implements only the v2 version of the instance API, not the v1. Since Mastodon does not remove the old ones, I currently do not take that into account. I should probably do that. Both would be good, probably, ideally they should support v1 for compat, and I should obviously use v2 when v1 is not available. Currently once again busy with other stuff, so I can't promise a timeline on a fix, but if you want to quickly kludge it yourself, you probably can make it work by looking at api docs and swapping URLs around (maybe even just v1 to v2 in there is good enough, not sure) Thank you, in any case, for the report! |
Is that possible to specify which version API ( |
it's per endpoint, there's (intended to be a) _v1 and _v2 version for functions that have multiple variants and one without suffix that selects dynamically, but I think in the current stable version on pip, I didn't implement that for the v2 instance API yet (and in any case, the reason it fails for streaming is that the streaming API calls this internally because I needs to get the streaming endpoints from the return value, so you actually couldn't fix it that way). I will, eventually, but I keep getting sidetracked. As a workaround, you could edit your local copy of Mastodon.py and replace /v1/ with /v2/ in the "__instance" function (may break things) or, as you said, proxy rewrite it. |
unfortunately Traceback (most recent call last):
File "/home/gameplayer/workspace/followatch-sharkey/app/runner.py", line 223, in <module>
setup()
File "/home/gameplayer/workspace/followatch-sharkey/app/runner.py", line 214, in setup
main()
File "/home/gameplayer/workspace/followatch-sharkey/app/runner.py", line 187, in main
mastodon_instance.status_post('**FolloWatch** Booted up.', visibility='direct')
File "/usr/lib/python3.11/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mastodon/utility.py", line 49, in wrapper
return function(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mastodon/statuses.py", line 248, in status_post
return self.__status_internal(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mastodon/statuses.py", line 182, in __status_internal
return self.__api_request('POST', '/api/v1/statuses', params, headers=headers, use_json=use_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mastodon/internals.py", line 297, in __api_request
raise ex_type('Mastodon API returned error', response_object.status_code, response_object.reason, error_msg)
mastodon.errors.MastodonNotFoundError: ('Mastodon API returned error', 404, 'Not Found', 'Not Found')
Will try that now. |
replacing |
Good afternoon,
How do I disable the check of remote Mastodon instance version in Mastodon.py?
I'm using Sharkey version
v2024.3.1
which contains an API mostly compatible with Mastodon API.The current error what I'm getting is:
The text was updated successfully, but these errors were encountered: