From 03dc524f80a248469075e66294626df2cc93375a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 4 Jul 2020 00:15:44 +0200 Subject: [PATCH] Fixed response type --- platypush/plugins/media/__init__.py | 4 ++-- platypush/plugins/media/kodi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/plugins/media/__init__.py b/platypush/plugins/media/__init__.py index fd566350..1363bbc7 100644 --- a/platypush/plugins/media/__init__.py +++ b/platypush/plugins/media/__init__.py @@ -478,8 +478,8 @@ class MediaPlugin(Plugin): threading.Thread(target=_youtube_dl_thread).start() - @action - def get_youtube_id(self, url: str) -> Optional[str]: + @staticmethod + def get_youtube_id(url: str) -> Optional[str]: patterns = [ re.compile(pattern) for pattern in [ diff --git a/platypush/plugins/media/kodi.py b/platypush/plugins/media/kodi.py index 0d3eb86c..b105def8 100644 --- a/platypush/plugins/media/kodi.py +++ b/platypush/plugins/media/kodi.py @@ -158,7 +158,7 @@ class MediaKodiPlugin(MediaPlugin): youtube_id = self.get_youtube_id(resource) if youtube_id: try: - resource = self.get_youtube_url('https://www.youtube.com/watch?v=' + youtube_id) + resource = self.get_youtube_url('https://www.youtube.com/watch?v=' + youtube_id).output except Exception as e: self.logger.warning('youtube-dl error, falling back to Kodi YouTube plugin: {}'.format(str(e))) resource = 'plugin://plugin.video.youtube/?action=play_video&videoid=' + youtube_id