build: docker
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
import requests
|
||||
|
||||
host = 'http://192.168.124.12:4533'
|
||||
|
||||
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)
|
||||
res = requests.get(f'{host}/api/playlist?_end=50&_order=ASC&_sort=id&_start=0', headers = headers)
|
||||
resJson = res.json()
|
||||
return resJson
|
||||
|
||||
@ -13,13 +15,13 @@ def downloadPlayList(palyListId, token):
|
||||
'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)
|
||||
res = requests.get(f'{host}/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)
|
||||
res = requests.delete(f'{host}/api/playlist/{playlistId}', headers = headers)
|
||||
resJson = res.json()
|
||||
return resJson
|
@ -25,9 +25,9 @@ def start():
|
||||
|
||||
sync()
|
||||
|
||||
# if len(delPlaylistIds) > 0:
|
||||
# for delId in delPlaylistIds:
|
||||
# delPlaylist(delId, token)
|
||||
if len(delPlaylistIds) > 0:
|
||||
for delId in delPlaylistIds:
|
||||
delPlaylist(delId, token)
|
||||
|
||||
if __name__ == 'main':
|
||||
start()
|
||||
|
Reference in New Issue
Block a user