I'm trying to make a python script to upload to clipwatching via api, but I'm stuck. Below is a script I use and the response, I get. No error, but also no file in my account. I can't figure what I'm doing wrong. Can anyone help?
#!/usr/bin/env python3
import requests
api_key='actual_key'
resp_prepare = requests.get('https://clipwatching.com/api/upload/server?key='+api_key)
upload_url = resp_prepare.json()["result"]
params = {
'api_key' : api_key
}
headers_post = {
'cache-control': 'no-cache',
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW',
}
response = requests.post(upload_url, headers=headers_post,params=params, files={'file': open('test_video.mp4','rb')})
print(response.content)
Response:
b'<HTML><BODY><Form name=\'F1\' action=\'https://clipwatching.com/\' target=\'_parent\' method=\'POST\'><textarea name="op">upload_result</textarea></Form><Script>document.location=\'javascript:false\';document.F1.submit();</Script></BODY></HTML>'
#!/usr/bin/env python3
import requests
api_key='actual_key'
resp_prepare = requests.get('https://clipwatching.com/api/upload/server?key='+api_key)
upload_url = resp_prepare.json()["result"]
params = {
'api_key' : api_key
}
headers_post = {
'cache-control': 'no-cache',
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW',
}
response = requests.post(upload_url, headers=headers_post,params=params, files={'file': open('test_video.mp4','rb')})
print(response.content)
Response:
b'<HTML><BODY><Form name=\'F1\' action=\'https://clipwatching.com/\' target=\'_parent\' method=\'POST\'><textarea name="op">upload_result</textarea></Form><Script>document.location=\'javascript:false\';document.F1.submit();</Script></BODY></HTML>'