Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import time
- import os
- import random
- url = 'https://2ch.hk/makaba/posting.fcgi'
- data = {
- 'task': 'post',
- 'board': 'asylum',
- 'thread': '491627',
- 'email': '',
- 'name': '',
- 'subject': '',
- 'comment': '1',
- }
- pack = 'D:/pics/'
- page = requests.get("https://2ch.hk/asylum/res/491627.json").json()
- all = page['threads'][0]['posts']
- random.shuffle(all)
- for post in all:
- filename = random.choice(os.listdir(pack))
- filepath = os.path.join(pack, filename)
- files = {'image1': open(filepath, 'rb').read()}
- data['comment'] = post['comment']
- requests.post(url, data=data, files=files)
- time.sleep(20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement