diff --git a/config.ini b/config.ini index 230c539..8a313b1 100644 --- a/config.ini +++ b/config.ini @@ -6,6 +6,11 @@ modules = telegram # Mastodon instance to grab posts from instance = mastodon.example.org +# Uncomment and change this if your instance makes invalid redirects +# on the streaming path (like mastodon.social does). Check the following issue +# for more details: https://github.com/hatkidchan/mastoposter/issues/45 +#streaming-url = wss://streaming.mastodon.example.org/api/v1/streaming + # Mastodon user token. # Required permissions: read:accounts read:statuses read:lists # You can get your token by creating application in diff --git a/mastoposter/__main__.py b/mastoposter/__main__.py index 24188e8..d360fa7 100644 --- a/mastoposter/__main__.py +++ b/mastoposter/__main__.py @@ -136,7 +136,10 @@ def main(): logger.info("account.id=%s", user_id) - url = "wss://{}/api/v1/streaming".format(conf["main"]["instance"]) + url = conf["main"].get( + "streaming_url", + "wss://{}/api/v1/streaming".format(conf["main"]["instance"]), + ) run( listen(