Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cloudscraper
- import requests
- from requests_toolbelt.multipart.encoder import MultipartEncoder
- import codecs
- import random
- proxies = [
- ]
- refresh_id=[
- ]
- board = 'b'
- thread = '286525290'
- # comment = ('')
- def get_new_proxy(proxy):
- s.proxies = {"http": proxy, "https": proxy}
- def get_captcha_id():
- res = s.get("https://2ch.hk/api/captcha/2chcaptcha/id?board=" + board + "&thread=" + thread)
- return res.json()['id']
- def get_captcha_value(captchaid):
- captchaget = s.get("https://2ch.hk/api/captcha/2chcaptcha/show?id=" + captchaid)
- img_file = open('captcha.jpg', 'wb')
- img_file.write(captchaget.content)
- img_file.close()
- return input("В: ")
- def post(board, thread, comment, captcha_value, captcha_id):
- mp_encoder = MultipartEncoder(
- fields={
- "task": "post",
- "board": board,
- "thread": thread,
- "usercode": "",
- "code": "",
- "captcha_type": "2chcaptcha",
- "email": "sage",
- "comment": comment,
- "oekaki_image": "",
- "oekaki_metadata": "",
- "2chcaptcha_value": captcha_value,
- "2chcaptcha_id": captcha_id,
- "makaka_id": "",
- "makaka_answer": "",
- # 'file[]': ['zxcv',open('zxcv.jpg', 'rb')]
- }
- )
- response = s.post('https://2ch.hk/user/posting', data=mp_encoder, headers={'Content-Type': mp_encoder.content_type})
- print(response.text)
- return response.text
- while True:
- fileObj = codecs.open(str(random.randrange(100)) + '.txt', 'r')
- comment = fileObj.read()
- fileObj.close()
- for i in proxies:
- s = cloudscraper.CloudScraper()
- get_new_proxy(i)
- captcha_id = get_captcha_id()
- captcha_value = get_captcha_value(captcha_id)
- post(board, thread, comment, captcha_value, captcha_id)
- #r = requests.get('' + refresh_id[proxies.index(i)]) секретный сайт
- #print(r.text)
Add Comment
Please, Sign In to add comment