Adding music/tidal url and function

This commit is contained in:
blacktwin 2019-12-05 13:02:22 -05:00
parent f7938cf06e
commit d6f7ad7e10

View file

@ -78,6 +78,7 @@ class MyPlexAccount(PlexObject):
WEBSHOWS = 'https://webshows.provider.plex.tv/hubs/' # get
NEWS = 'https://news.provider.plex.tv/hubs/' # get
PODCASTS = 'https://podcasts.provider.plex.tv/hubs/' # get
MUSIC = 'https://music.provider.plex.tv/hubs/' # get
# Key may someday switch to the following url. For now the current value works.
# https://plex.tv/api/v2/user?X-Plex-Token={token}&X-Plex-Client-Identifier={clientId}
key = 'https://plex.tv/users/account'
@ -658,6 +659,16 @@ class MyPlexAccount(PlexObject):
return items
def tidal(self):
""" Returns a list of tidal Hub items :class:`~plexapi.library.Hub`
"""
items = []
data = self.query(url=self.MUSIC)
for elem in data:
items.append(Hub(server=self._server, data=elem))
return items
class MyPlexUser(PlexObject):
""" This object represents non-signed in users such as friends and linked