diff --git a/useless/shitpostbot5k.py b/useless/shitpostbot5k.py
index 7195e221ac36be5d96f3f3d978c85aa51beb9fa8..7995bfb3878a495d49aba8abd3dac2a069579cc2 100755
--- a/useless/shitpostbot5k.py
+++ b/useless/shitpostbot5k.py
@@ -62,7 +62,7 @@ class Shitpostbot5000(object):
         self.ctx = ssl.create_default_context()
         self.ctx.check_hostname = False
         self.ctx.verify_mode = ssl.CERT_NONE
-        urllib.request.urlretrieve(random.choice(self.getlinks(hashtag, 'https://www.instagram.com/explore/tags/' + hashtag + '/')), 'insta_random.jpg')
+        urllib.request.urlretrieve(random.choice(self.getlinks(hashtag, 'https://www.instagram.com/explore/tags/' + hashtag.strip() + '/')), 'insta_random.jpg')
         return 'insta_random.jpg'