From a7e2caa369639feb9c7562346dbb3d0827b37491 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Wed, 29 Nov 2017 18:04:54 +0100 Subject: [PATCH] Check hashtags in streaming API --- mastodon/Mastodon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 9df51ea..2f84635 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -1044,6 +1044,8 @@ class Mastodon: a subclass of StreamListener which will receive callbacks for incoming events. """ + if tag.startswith("#"): + raise MastodonIllegalArgumentError("Tag parameter should omit leading #") return self.__stream("/api/v1/streaming/hashtag?tag={}".format(tag), listener) ###