· 6 years ago · Jan 26, 2020, 02:48 PM
1import os
2
3# без передачи этих параметров не стартует, но делать их обязательными для ввода даже если они не нужны - глупо
4# какая вайпалка - такие и костыли
5medias = 0
6jackal = 0
7password = '0'
8
9print('Welcome to BUND WIPE MACHINE configurator (GUI sucks)!')
10print('Here you may choose needed params to exeс 2ch-wiper. Let\'s start.')
11
12# username + password
13# Нужно добавить проверку аккаунта, но увы, доступа к серваку у меня нет
14username = input('Username (any one if not registered): ')
15password = input('Password (leave empty if not registered): ')
16
17# board index
18Mistake = True
19boards = ['b', 'vg', 'fag', 'po', 'news', 'v', 'hw', 'sex', 'mov', 'a', 'soc', '2d', 'au', 'sp', 'wrk', 'hry', 'ma',
20 'wm', 'hi', 'mobi', 'gsg', 'di', 'dr', 'tes', 's', 'kpop', 'tv', 'ga', 'brg', 'pr', 'cg', 'gabe', 'rf', 'es',
21 'me', 'spc', 'bg', 'fg', 'bo', 'pa', 'biz', 'psy', 'socionics', 'bi', 'd', 'fet', 'mus', 'c', 'gd', 'w', 'fs',
22 'hc', 'ra', 't', 'p', 'mu', 'ftb', 're', 'fd', 'e', 'sci', 'izd', 'vn', 'sw', 'ch', 'whn', 'fa', 'wh', 'ukr',
23 'alco', 'obr', 'ruvn', 'fiz', 'mg', 'dom', 'mmo', 'se', 'mlp', 'h', 'zog', 'em', 'sn', 'un', 'fur', 'fl',
24 'mc', 'gg', 'cc', 'wow', 'hh', 'mo', 'ne', 'wp', 'media', 'kz', 'crypt', 'vape', 'pok', 'hv', 'ew', 'pvc',
25 'ph', 'de', 'diy', 'td', 'to', 'r', 'ho', 'br', 'trv', 'law', 'cute', 'by', 'fem', 'sf', 'tr', 'wr', 'aa',
26 'ja', 'rm', 'web', 'gb', 'moba', 'abu', 'cul', 'out', 'old', 'guro', 'ussr', 'jsf', 'm', 'ya', 'r34', 'qtr4',
27 '8', 'mlpr', 'ro', 'who', 'srv', 'asmr', 'electrach', 'ing', 'got', 'lap', 'smo', 'hg', 'sad', 'fi', 'nvr',
28 'ind', 'ld', 'vr', 'o', 'arg', 'char', 'wwe', 'int', 'math', 'catalog', 'api']
29while Mistake:
30 board = input('Board index (b/a/vg/...): ')
31 if board in boards:
32 Mistake = False
33 else:
34 print('There\'s no such board, baka!')
35
36# mode (thread or shrapnel) + thread number
37Mistake = True
38while Mistake:
39 mode_tob = input('Wipe for whole board (b) or just one thread (t): ')
40 if mode_tob == 't':
41 shrapnel = 0
42 min = 0
43 while Mistake:
44 try:
45 thread = int(input('Thread number: '))
46 except ValueError:
47 print('Number can\'t be string!')
48 continue
49 if thread < 1:
50 print('Wrong thread number, desu~')
51 else:
52 Mistake = False
53 elif mode_tob == 'b':
54 while Mistake:
55 try:
56 shrapnel = int(input('Amount of threads for board wipe: '))
57 except ValueError:
58 print('Amount can\'t be string!')
59 continue
60 if shrapnel < 1:
61 print('Wrong amount of threads!')
62 else:
63 while Mistake:
64 try:
65 min = int(input('Minimum posts in one thread: '))
66 except ValueError:
67 print('Amount can\'t be string!')
68 continue
69 if min < 1:
70 print('Wrong amount of posts!')
71 else:
72 Mistake = False
73 thread = 1
74 else:
75 print('You made a mistake, senpai!')
76
77# chaos
78Mistake = True
79while Mistake:
80 chaos = input('Enable \"Random chaos\" mode (y/n): ')
81 if chaos == 'y':
82 Mistake = False
83 chaos = 0
84 elif chaos == 'n':
85 Mistake = False
86 chaos = -1
87 else:
88 print('You have to decide: yes or no. Is it fucking difficult?!')
89
90# potoks
91Mistake = True
92while Mistake:
93 try:
94 potoks = int(input('Amount of threads (characterises speed): '))
95 except ValueError:
96 print('Amount can\'t be string!')
97 continue
98 if potoks < 1:
99 print('You\'re too slow!')
100 else:
101 Mistake = False
102
103# debug
104Mistake = True
105while Mistake:
106 debug = input('Enable debug mode (y/n): ')
107 if debug == 'y':
108 Mistake = False
109 debug = 1
110 elif debug == 'n':
111 Mistake = False
112 debug = 0
113 else:
114 print('You have to decide between TWO variants!')
115
116# solver
117Mistake = True
118print('0 - x-captcha.ru')
119print('1 - captcha.guru')
120print('2 - anti-captcha.com')
121while Mistake:
122 try:
123 solver = int(input('Choose solver by number: '))
124 except ValueError:
125 print('Number can\'t be string!')
126 continue
127 if solver not in [0, 1, 2]:
128 print('Someday we\'ll add another one, but not today.')
129 else:
130 Mistake = False
131
132# key
133# Можно добавить проверку ключа реквестом на баланс, но мне лень
134key = input('Your key (make sure it\'s right!): ')
135
136# repeats
137Mistake = True
138while Mistake:
139 try:
140 repeats = int(input('Amount of posts from proxy: '))
141 except ValueError:
142 print('Amount can\'t be string!')
143 continue
144 if repeats < 1:
145 print('Not enough!')
146 else:
147 Mistake = False
148
149# mode
150print('2 - [no text]')
151print('3 - >greentext')
152print('7 - copy others\' posts')
153print('4 - pastes')
154print('0 - random symbols')
155Mistake = True
156while Mistake:
157 try:
158 mode = int(input('Choose wiper mode by number: '))
159 except ValueError:
160 print('Number can\'t be string!')
161 continue
162 if mode not in [2, 3, 7, 4, 0]:
163 print('Someday we\'ll add another mode, but today only 5 ones.')
164 else:
165 Mistake = False
166
167# minBan, maxBan, cb, l, w - это видать для репортов, хз работает или нет и что сюда передавать
168
169# trigger
170print('0 - no trigger')
171print('1 - chain')
172print('2 - random')
173print('3 - baton')
174print('4 - only OP')
175Mistake = True
176while Mistake:
177 try:
178 trigger = int(input('Choose trigger mode by number: '))
179 except ValueError:
180 print('Number can\'t be string!')
181 continue
182 if trigger not in [0, 1, 2, 3, 4]:
183 print('Someday we\'ll add another trigger, but today only 5 ones.')
184 else:
185 Mistake = False
186
187# media
188print('0 - no media (also if wiping /d/)')
189print('1 - pictures')
190print('2 - webm')
191print('3 - take from posts')
192Mistake = True
193while Mistake:
194 try:
195 media = int(input('Choose attachments\' type by number: '))
196 except ValueError:
197 print('Number can\'t be string!')
198 continue
199 if media not in [0, 1, 2, 3]:
200 print('One more type? But what?')
201 else:
202 Mistake = False
203 # picture settings
204 if media == 1 or media == 3:
205 # colorize
206 Mistake = True
207 while Mistake:
208 color = input('Colorize pictures (y/n): ')
209 if color == 'y':
210 Mistake = False
211 color = 1
212 elif color == 'n':
213 Mistake = False
214 color = 0
215 else:
216 print('Please, choose right answer.')
217
218 # convert
219 Mistake = True
220 while Mistake:
221 png = input('Convert to png (y/n): ')
222 if png == 'y':
223 Mistake = False
224 png = 1
225 elif png == 'n':
226 Mistake = False
227 png = 0
228 else:
229 print('Just Yes or No.')
230
231 # affine
232 Mistake = True
233 while Mistake:
234 affine = input('Affine picture (y/n): ')
235 if affine == 'y':
236 Mistake = False
237 affine = 1
238 elif affine == 'n':
239 Mistake = False
240 affine = 0
241 else:
242 print('Just Yes or No.')
243
244 # jackal
245 Mistake = True
246 while Mistake:
247 try:
248 jackal = 100 - int(input('Picture quality (1 - 100): '))
249 except ValueError:
250 print('Number can\'t be string!')
251 continue
252 if jackal < 0 or jackal > 100:
253 print('Wrong number!')
254 else:
255 Mistake = False
256
257# folder + amount + settings
258if media != 0:
259 # Директорию можно чекать на правильность попыкой создания файла в ней и отлавливанием ошибки, но мне лень
260 group = input('Directory of attachments (\'.\' if in root directory or taking from posts): ')
261
262 # amount
263 if media in [1, 2]:
264 Mistake = True
265 while Mistake:
266 try:
267 medias = int(input('Choose attachments\' amount (1 -4): '))
268 except ValueError:
269 print('Amount can\'t be string!')
270 continue
271 if medias not in [1, 2, 3, 4]:
272 print('Buy passcode)')
273 else:
274 Mistake = False
275
276 # randomize
277 Mistake = True
278 while Mistake:
279 random = input('Randomize filenames (y/n): ')
280 if random == 'y':
281 Mistake = False
282 random = 1
283 elif random == 'n':
284 Mistake = False
285 random = 0
286 else:
287 print('Just Yes or No.')
288
289# SAGE
290print('0 - no sage')
291print('1 - always')
292print('2 - take from posts')
293Mistake = True
294while Mistake:
295 try:
296 sage = int(input('Choose sage mode by number: '))
297 except ValueError:
298 print('Number can\'t be string!')
299 continue
300 if sage not in [0, 1, 2]:
301 print('No such mode!')
302 else:
303 Mistake = False
304
305# Собираем всё в кучу, ммм
306request_string = f'python engine/main.py -u {username} --password {password} -b {board} -c {chaos} -p {potoks} -d {debug} -s {solver} -k {key} -r {repeats} -m {mode} -T {trigger} -M {media} -S {sage} -mc {medias} -SH {jackal} -mp {min} -sh {shrapnel}'
307if 'thread' in globals():
308 request_string += f' -t {thread}'
309if 'group' in globals():
310 request_string += f' -g {group}'
311if 'random' in globals():
312 request_string += f' -rn {random}'
313if 'color' in globals():
314 request_string += f' -C {color}'
315if 'affine' in globals():
316 request_string += f' -a {affine}'
317if 'png' in globals():
318 request_string += f' -P {png}'
319
320print('Here\'s your launch string:')
321print(request_string)
322
323
324Mistake = True
325while Mistake:
326 start = input('Do you want to start wiper? (y/n): ')
327 if start == 'y':
328 Mistake = False
329 print('Starting...')
330 os.system(request_string)
331 elif start == 'n':
332 Mistake = False
333 print('Ok. See you next time!')
334 else:
335 print('y or n!?')