You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
500 B

import json
import requests
from Config import *
url = DIFY_URL + "/audio-to-text"
payload = {'user': 'abc-123'}
files = [
('file', ('1.png', open(r'D:\KeCheng\片头曲\1_建工高启强_去片头_(人声).mp3', 'rb'), 'type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]'))
]
headers = {
'Authorization': 'Bearer ' + DIFY_API_KEY
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
json_data = json.loads(response.text)
print(json_data)