first commit

This commit is contained in:
mol
2023-02-04 00:14:50 +08:00
commit a2f1b6d4fd
51 changed files with 839 additions and 0 deletions

View 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