From f3bdeaf41826b810f4012038ad589798cb33d974 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 27 Jun 2018 08:56:21 +0200 Subject: [PATCH] Fixed Spotify URIs conversion --- platypush/plugins/media/ctrl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/media/ctrl.py b/platypush/plugins/media/ctrl.py index c963a522c..c5c87f579 100644 --- a/platypush/plugins/media/ctrl.py +++ b/platypush/plugins/media/ctrl.py @@ -29,8 +29,8 @@ class MediaCtrlPlugin(Plugin): @classmethod def _get_type_and_resource_by_url(cls, url): # MPD/Mopidy media (TODO support more mopidy types) - m = re.match('^https://open.spotify.com/([^/]+)/(.*)', url) - if m: url = 'spotify:{}:{}'.format(m.group(1), m.group(2)) + m = re.search('^https://open.spotify.com/([^?]+)', url) + if m: url = 'spotify:{}'.format(m.group(1).replace('/', ':')) if url.startswith('spotify:') \ or url.startswith('tunein:') \ or url.startswith('soundcloud:'):