Skip to content

Commit 11a1b6e

Browse files
committed
remove 'hubs/' from global vars and append to methods
setting global var without hubs for future reference
1 parent 0dfae68 commit 11a1b6e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

plexapi/myplex.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ class MyPlexAccount(PlexObject):
7474
SIGNIN = 'https://plex.tv/users/sign_in.xml' # get with auth
7575
WEBHOOKS = 'https://plex.tv/api/v2/user/webhooks' # get, post with data
7676
# Hub sections
77-
VOD = 'https://vod.provider.plex.tv/hubs/' # get
78-
WEBSHOWS = 'https://webshows.provider.plex.tv/hubs/' # get
79-
NEWS = 'https://news.provider.plex.tv/hubs/sections/all' # get
80-
PODCASTS = 'https://podcasts.provider.plex.tv/hubs/' # get
81-
MUSIC = 'https://music.provider.plex.tv/hubs/' # get
77+
VOD = 'https://vod.provider.plex.tv/' # get
78+
WEBSHOWS = 'https://webshows.provider.plex.tv/' # get
79+
NEWS = 'https://news.provider.plex.tv/' # get
80+
PODCASTS = 'https://podcasts.provider.plex.tv/' # get
81+
MUSIC = 'https://music.provider.plex.tv/' # get
8282
# Key may someday switch to the following url. For now the current value works.
8383
# https://plex.tv/api/v2/user?X-Plex-Token={token}&X-Plex-Client-Identifier={clientId}
8484
key = 'https://plex.tv/users/account'
@@ -622,35 +622,35 @@ def history(self, maxresults=9999999, mindate=None):
622622
def videoOnDemand(self):
623623
""" Returns a list of VOD Hub items :class:`~plexapi.library.Hub`
624624
"""
625-
req = requests.get(self.VOD, headers={'X-Plex-Token':self._token})
625+
req = requests.get(self.VOD + 'hubs/', headers={'X-Plex-Token':self._token})
626626
elem = ElementTree.fromstring(req.text)
627627
return self.findItems(elem)
628628

629629
def webShows(self):
630630
""" Returns a list of Webshow Hub items :class:`~plexapi.library.Hub`
631631
"""
632-
req = requests.get(self.WEBSHOWS, headers={'X-Plex-Token':self._token})
632+
req = requests.get(self.WEBSHOWS + 'hubs/', headers={'X-Plex-Token':self._token})
633633
elem = ElementTree.fromstring(req.text)
634634
return self.findItems(elem)
635635

636636
def news(self):
637637
""" Returns a list of News Hub items :class:`~plexapi.library.Hub`
638638
"""
639-
req = requests.get(self.NEWS, headers={'X-Plex-Token':self._token})
639+
req = requests.get(self.NEWS + 'hubs/', headers={'X-Plex-Token':self._token})
640640
elem = ElementTree.fromstring(req.text)
641641
return self.findItems(elem)
642642

643643
def podcasts(self):
644644
""" Returns a list of Podcasts Hub items :class:`~plexapi.library.Hub`
645645
"""
646-
req = requests.get(self.PODCASTS, headers={'X-Plex-Token':self._token})
646+
req = requests.get(self.PODCASTS + 'hubs/', headers={'X-Plex-Token': self._token})
647647
elem = ElementTree.fromstring(req.text)
648648
return self.findItems(elem)
649649

650650
def tidal(self):
651651
""" Returns a list of tidal Hub items :class:`~plexapi.library.Hub`
652652
"""
653-
req = requests.get(self.MUSIC, headers={'X-Plex-Token':self._token})
653+
req = requests.get(self.MUSIC + 'hubs/', headers={'X-Plex-Token': self._token})
654654
elem = ElementTree.fromstring(req.text)
655655
return self.findItems(elem)
656656

0 commit comments

Comments
 (0)