Python sends request tags

So, I need to set the tags for the video that I am uploading, but I cannot get it to work. This is the tag 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 this is my code:

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 tried a lot of different things, formatting the tags as a list with or without space, I tried to encode the string in json, the website still returns a message about the need to send tags. Does anyone know what I'm doing wrong?

And one more thing, checking http headers / requests in the browser, I noticed that whenever I print tags, I get a GET request from the site, looking like this:
GET /account/title_blacklist/?title=tag1%20tag2(maybe this is useful?)

+4
source share
2 answers

, , , , . :

  • , checkTags() Javascript . GET, , AJAX , , , . , , , "" ( ). , GET URL-, GET. , , , . (, Chrome), POST, .
  • , CSRF. , , . . , . , ( -) . , CSRF , .

, - , <form>, <input>. , !

+1

. "", . , .

0

Source: https://habr.com/ru/post/1598386/


All Articles