Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import requests
  2. import json
  3.  
  4. c = requests.get('https://2ch.hk/api/captcha/2chaptcha/service_id')
  5. cid = json.loads(c.text)['id']
  6. cimg = requests.get('https://2ch.hk/api/captcha/2chaptcha/image/' + cid)
  7. cimgfile = open('./captcha.png', 'wb')
  8. cimgfile.write(cimg.content)
  9. cimgfile.close()
  10.  
  11. ctext = input('Enter captcha: ')
  12.  
  13. post = {'json': 1,
  14.     'board': 'pr',
  15.     'task': 'post',
  16.     'thread': 1025332,
  17.     'comment': 'тест',
  18.     'captcha_type': '2chaptcha',
  19.     '2chaptcha_id': cid,
  20.     '2chaptcha_value': ctext}
  21.  
  22.  
  23. r = requests.post('https://2ch.hk/makaba/posting.fcgi', data = post)
  24. print(r.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement