We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27bf1b4 commit 86d735fCopy full SHA for 86d735f
1 file changed
core/api/aplm.py
@@ -57,6 +57,13 @@ def __parse_url(self, url):
57
if u.query:
58
self.songId = u.query.replace('i=', '')
59
60
+ if self.kind == 'song':
61
+ r = self.session.get(f"https://amp-api.music.apple.com/v1/catalog/us/songs/{self.id}")
62
+ r = json.loads(r.text)
63
+ self.kind = 'album'
64
+ self.songId = self.id
65
+ self.id = r['data'][0]['relationships']['albums']['data'][0]['id']
66
+
67
logger.debug(f'UrlParseResult(kind="{self.kind}", id="{self.id}", songId="{self.songId}")')
68
else:
69
logger.error("Url is invalid!", 1)
0 commit comments