Make sure that extra arguments on the Spotify URI are discarded during the URI parse
This commit is contained in:
parent
ee0040fba6
commit
05a1713b92
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue