написал запрос для получения плеера

This commit is contained in:
Mike0001-droid 2024-06-25 13:14:50 +05:00
parent 8a10809514
commit d5ad0d007c
1 changed files with 11 additions and 0 deletions

View File

@ -243,6 +243,17 @@ class SongViewSet(GenericViewSet):
data.append(i) data.append(i)
return Response(data, status=status.HTTP_200_OK) return Response(data, status=status.HTTP_200_OK)
@action(detail=False, methods=['get'])
def get_nowplaying(self, request):
file_url = F"{AZURACAST_URL}api/nowplaying/it-radio"
API_KEY = AZURACAST_API_KEY
headers = {
"Authorization": f"Bearer {API_KEY}"
}
response = requests.get(file_url, headers=headers)
return Response(response.json(), status=status.HTTP_200_OK)