Files
digiserver/import requests.py
2025-03-25 10:27:25 +02:00

19 lines
628 B
Python

import requests
# Replace with the actual server IP address or domain name and quick connect code
server_ip = 'http://192.168.0.115:5000'
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())