diff --git a/platypush/plugins/music/mpd/__init__.py b/platypush/plugins/music/mpd/__init__.py index adf163cd3b..42bcdbfc83 100644 --- a/platypush/plugins/music/mpd/__init__.py +++ b/platypush/plugins/music/mpd/__init__.py @@ -257,10 +257,16 @@ class MusicMpdPlugin(MusicPlugin): @classmethod def _parse_resource(cls, resource): + if not resource: + return + m = re.search('^https://open.spotify.com/([^?]+)', resource) if m: resource = 'spotify:{}'.format(m.group(1).replace('/', ':')) - if resource and resource.startswith('spotify:playlist:'): + if resource.startswith('spotify:'): + resource = resource.split('?')[0] + + if resource.startswith('spotify:playlist:'): # Old Spotify URI format, convert it to new m = re.match('^spotify:playlist:(.*)$', resource) resource = 'spotify:user:spotify:playlist:' + m.group(1)