16 lines
383 B
Python
16 lines
383 B
Python
import requests as rq
|
|
|
|
|
|
class Georg:
|
|
def __init__(self):
|
|
|
|
self.url = "https://georg-backend.pvv.ntnu.no"
|
|
|
|
self.currentlyPlaying = self.getCurrentlyPlaying()
|
|
|
|
def getCurrentlyPlaying(self):
|
|
return rq.get(f"{self.url}/api/play").json()["value"]
|
|
|
|
def togglePlay(self):
|
|
return rq.post(f"{self.url}/play?play={not self.getCurrentlyPlaying()}")
|