From cf73639281d981b22f1d6936918908cc73e0e65d Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 28 Apr 2018 18:23:10 -0700 Subject: [PATCH] Fix Twitter notification with self-hosted images (Fixes Tautulli/Tautulli-Issues#54) --- plexpy/notifiers.py | 4 ++++ plexpy/webserve.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index a6fffb1f..e2e32f91 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -3434,6 +3434,10 @@ class TWITTER(Notifier): parameters = kwargs['parameters'] poster_url = parameters.get('poster_url','') + # Hack to add media type to attachment + if poster_url: + poster_url += '.png' + if self.config['incl_subject']: return self._send_tweet(subject + '\r\n' + body, attachment=poster_url) else: diff --git a/plexpy/webserve.py b/plexpy/webserve.py index edd3a40a..aeac2026 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -4020,7 +4020,7 @@ class WebInterface(object): @cherrypy.expose def image(self, *args, **kwargs): if args: - img_hash = args[0] + img_hash = args[0].split('.')[0] if img_hash in ('poster', 'cover', 'art'): if img_hash == 'poster':