Fixed Spotify URIs conversion

This commit is contained in:
Fabio Manganiello 2018-06-27 08:56:21 +02:00
parent b55c070e46
commit f3bdeaf418
1 changed files with 2 additions and 2 deletions

View File

@ -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:'):