started implementing player and play
This commit is contained in:
parent
0726e15c9d
commit
b95ca24f28
4
main.py
4
main.py
@ -7,4 +7,6 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
network = networkclass.network(userclass.User())
|
network = networkclass.network(userclass.User())
|
||||||
|
|
||||||
network.getPlaylist('000Eh2vXzYGgrEFlgcWZj3')
|
#network.getPlaylist('000Eh2vXzYGgrEFlgcWZj3')
|
||||||
|
|
||||||
|
network.getPlayer()
|
||||||
|
@ -92,3 +92,19 @@ class network:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("Couldn't Pull Playlist " + str(playlistid) + ' ' + str(req.status_code))
|
raise ValueError("Couldn't Pull Playlist " + str(playlistid) + ' ' + str(req.status_code))
|
||||||
|
|
||||||
|
def getPlayer(self):
|
||||||
|
|
||||||
|
headers = {'Authorization': 'Bearer ' + self.user.access_token}
|
||||||
|
|
||||||
|
req = requests.get(const.api_url + 'me/player', headers=headers)
|
||||||
|
|
||||||
|
print(req.status_code)
|
||||||
|
print(req.text)
|
||||||
|
|
||||||
|
def play(self, context, contexttype, deviceid=None):
|
||||||
|
|
||||||
|
headers = {'Authorization': 'Bearer ' + self.user.access_token}
|
||||||
|
|
||||||
|
params = {'limit': limit}
|
||||||
|
req = requests.put(const.api_url + 'me/player/play', params=params, headers=headers)
|
Loading…
Reference in New Issue
Block a user