Status
Not open for further replies.

syd2oo2

Active Member
55
2011
7
2,010
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>'
 
3 comments
What do you mean leecher code? I just want to upload a local file, in this case test_video.mp4, that is in the same folder where the script is via api. This exact script works on some hosters, and doesn't on clipwatching.
 
Status
Not open for further replies.
Back
Top