first commit
This commit is contained in:
25
plugin/NavidromePlaylistSync/api/playlist.py
Normal file
25
plugin/NavidromePlaylistSync/api/playlist.py
Normal file
@ -0,0 +1,25 @@
|
||||
import requests
|
||||
|
||||
def getPlaylist(token):
|
||||
headers = {
|
||||
'x-nd-authorization': f'Bearer {token}'
|
||||
}
|
||||
res = requests.get('https://music.hiiragi.club:8081/api/playlist?_end=50&_order=ASC&_sort=id&_start=0', headers = headers)
|
||||
resJson = res.json()
|
||||
return resJson
|
||||
|
||||
def downloadPlayList(palyListId, token):
|
||||
headers = {
|
||||
'Accept': 'audio/x-mpegurl',
|
||||
'x-nd-authorization': f'Bearer {token}'
|
||||
}
|
||||
res = requests.get(f'https://music.hiiragi.club:8081/api/playlist/{palyListId}/tracks', headers = headers)
|
||||
return res.content
|
||||
|
||||
def delPlaylist(playlistId, token):
|
||||
headers = {
|
||||
'x-nd-authorization': f'Bearer {token}'
|
||||
}
|
||||
res = requests.delete(f'https://music.hiiragi.club:8081/api/playlist/{playlistId}', headers = headers)
|
||||
resJson = res.json()
|
||||
return resJson
|
Reference in New Issue
Block a user