api added

This commit is contained in:
2025-03-19 16:49:10 +02:00
parent fe165305fc
commit 8f7639640d
7 changed files with 66 additions and 7 deletions

19
test_api.py Normal file
View 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())