Fixed response type

This commit is contained in:
Fabio Manganiello 2020-07-04 00:15:44 +02:00
parent c943acb9c2
commit 03dc524f80
2 changed files with 3 additions and 3 deletions

View file

@ -478,8 +478,8 @@ class MediaPlugin(Plugin):
threading.Thread(target=_youtube_dl_thread).start() threading.Thread(target=_youtube_dl_thread).start()
@action @staticmethod
def get_youtube_id(self, url: str) -> Optional[str]: def get_youtube_id(url: str) -> Optional[str]:
patterns = [ patterns = [
re.compile(pattern) re.compile(pattern)
for pattern in [ for pattern in [

View file

@ -158,7 +158,7 @@ class MediaKodiPlugin(MediaPlugin):
youtube_id = self.get_youtube_id(resource) youtube_id = self.get_youtube_id(resource)
if youtube_id: if youtube_id:
try: 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: except Exception as e:
self.logger.warning('youtube-dl error, falling back to Kodi YouTube plugin: {}'.format(str(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 resource = 'plugin://plugin.video.youtube/?action=play_video&videoid=' + youtube_id