change discover search url (#1239)

This commit is contained in:
twolaw 2023-09-17 23:06:45 +02:00 committed by GitHub
parent 5cd832e5a1
commit 9fd46872cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,6 +111,7 @@ class MyPlexAccount(PlexObject):
# Hub sections
VOD = 'https://vod.provider.plex.tv' # get
MUSIC = 'https://music.provider.plex.tv' # get
DISCOVER = 'https://discover.provider.plex.tv'
METADATA = 'https://metadata.provider.plex.tv'
key = 'https://plex.tv/api/v2/user'
@ -1056,7 +1057,7 @@ class MyPlexAccount(PlexObject):
'includeMetadata': 1
}
data = self.query(f'{self.METADATA}/library/search', headers=headers, params=params)
data = self.query(f'{self.DISCOVER}/library/search', headers=headers, params=params)
searchResults = data['MediaContainer'].get('SearchResults', [])
searchResult = next((s.get('SearchResult', []) for s in searchResults if s.get('id') == 'external'), [])