api added
This commit is contained in:
19
test_api.py
Normal file
19
test_api.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import requests
|
||||
|
||||
# Replace with the actual server IP address or domain name and quick connect code
|
||||
server_ip = 'Http://192.168.0.115'
|
||||
quickconnect_code = 'Initial01!'
|
||||
|
||||
# Construct the URL with the quick connect code as a query parameter
|
||||
url = f'{server_ip}/api/playlists?quickconnect_code={quickconnect_code}'
|
||||
|
||||
# Make the GET request to the API
|
||||
response = requests.get(url)
|
||||
|
||||
# Check if the request was successful
|
||||
if response.status_code == 200:
|
||||
# Parse the JSON response
|
||||
playlist = response.json().get('playlist', [])
|
||||
print('Playlist:', playlist)
|
||||
else:
|
||||
print('Failed to retrieve playlist:', response.json())
|
||||
Reference in New Issue
Block a user