19 lines
623 B
Python
19 lines
623 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'
|
|
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()) |