so, need set tags video upload, can't work. tags form:
<input id="video_keywords" class="ui-autocomplete-input" type="text" onchange="checktags()" onkeyup="checktags()" size="72" name="keywords" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true"> and code far:
payload = { 'keywords': 'tag1 tag2 tag3', 'apc_upload_progress': apc, 'message' : '', } files = {'upload_file' : (open("d:\\cpa\\videos\\watermarked\\test.avi", 'rb'))} url = 'http://upload.site.com/account/uploads/submit?video_type=other' r = s.post(url,data = payload,files = files,headers = headers) i've tried lots of different things, formatting tags list , without space between, tried encoding string json, website still returns message tags need submitted. has idea i'm doing wrong?
and thing, while inspecting http headers/requests in browser, i've noticed whenever type tags receive request site, looking :
get /account/title_blacklist/?title=tag1%20tag2 (maybe useful?)
there sorts of potential reasons isn't working, there's not enough information here why. here couple potential reasons:
- most likely,
checktags()javascript function performing sort of validation on tags. judging request showed, it's doing ajax server, , it's looking blacklisted tags. or, sending them server have format "validated" (less likely). in order test out, i'd try playing around requests url, putting different tags in parameters. seeing comes out, might better idea of tags you're allowed send. might try using browser's developer tools (like chrome's) view post data send form. - it's possible there sort of csrf token in form. server generates such token when sends form, , it's valid short period of time afterwards. sent server form data. server check token validity when receives form. exists prevent other people (especially malicious websites) submitting form data form. that, security reasons, server won't mention csrf token in response, , instead says tags reason error.
all of these possibilities can checked examining requests webpage sends in developer tools, , examining entire source of <form>, not specific <input>. helps!
Comments
Post a Comment