Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- c = requests.get('https://2ch.hk/api/captcha/2chaptcha/service_id')
- cid = json.loads(c.text)['id']
- cimg = requests.get('https://2ch.hk/api/captcha/2chaptcha/image/' + cid)
- cimgfile = open('./captcha.png', 'wb')
- cimgfile.write(cimg.content)
- cimgfile.close()
- ctext = input('Enter captcha: ')
- post = {'json': 1,
- 'board': 'pr',
- 'task': 'post',
- 'thread': 1025332,
- 'comment': 'тест',
- 'captcha_type': '2chaptcha',
- '2chaptcha_id': cid,
- '2chaptcha_value': ctext}
- r = requests.post('https://2ch.hk/makaba/posting.fcgi', data = post)
- print(r.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement