diff --git a/platypush/plugins/media/__init__.py b/platypush/plugins/media/__init__.py index fd566350fb..1363bbc725 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 0d3eb86cbe..b105def83b 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