def __init__(self, queue, model, status, sock, proxy): super(PostThead, self).__init__(None) self.queue = queue self.session = Rqbrowser() self.model = model if sock: self.session.set_proxies(sock5=sock) if proxy: self.session.set_proxies(proxy=proxy) self.status = status self.dic = {'vbb': 'bulletin_html'} self.subject = open('subject.txt').read() self.data = open('data.txt').read() self.html = None
def __init__(self, queue, signal, finish_signal, sock, proxy, reply): super(PostThead, self).__init__(None) self.queue = queue self.session = Rqbrowser() if sock: self.session.set_proxies(sock5=sock) if proxy: self.session.set_proxies(proxy=proxy) # self.dic = {'vbb': 'bulletin_html'} self.subject = open("subject.txt").read() self.data = open("data.txt").read() self.html = None self.signal = signal self.finish_signal = finish_signal self.reply = reply print ("Reply:", self.reply)
class PostThead(QThread): def __init__(self, queue, signal, finish_signal, sock, proxy, reply): super(PostThead, self).__init__(None) self.queue = queue self.session = Rqbrowser() if sock: self.session.set_proxies(sock5=sock) if proxy: self.session.set_proxies(proxy=proxy) # self.dic = {'vbb': 'bulletin_html'} self.subject = open("subject.txt").read() self.data = open("data.txt").read() self.html = None self.signal = signal self.finish_signal = finish_signal self.reply = reply print ("Reply:", self.reply) def run(self): while True: # print self.queue.qsize() item = self.queue.get() if item is None: break # reached end of queue ids = item[0] link = item[1] username = str(item[3]) password = str(item[4]) upbox = str(item[6]) # Sleep against stuck base. time.sleep(random.randint(100, 500) / 1000.0) try: # print 'Go to %s' % link html = self.session.open(link, header=headers, timeout=15) self.html = html ip_html = self.session.open("http://api.ipify.org?format=json", header=headers, timeout=15) ip = json.loads(ip_html.text) print ("Current IP : %s" % str(ip["ip"])) except requests.ConnectionError: print "Cant connect to requested file" self.signal.emit(ids, "ConnectionError") self.queue.task_done() if self.html is not None: if "javhug" in link or "javdmm" in link: print "Our blog Site" # VBB # ***************************************************************************************** if "vBulletin" in self.html.content or "vbulletin_html" in self.html.content: print "VBB" if "Version 4." in self.html.content: vbb4 = vbb.Vbbv4(self.session) login = vbb4.login(link, username, password) if login: if upbox == "Yes" and self.reply: # reply thread vbb4.reply_thread(link, self.data) self.signal.emit(ids, "Reply OK") self.queue.task_done() elif upbox == "No": post = vbb4.create_thread(link, self.subject, self.data) if post: xxxxx = self.session.open(link, header=headers) if self.subject in xxxxx.content: self.signal.emit(ids, "Done") self.queue.task_done() else: self.signal.emit(ids, "Post Failed") self.queue.task_done() else: self.signal.emit(ids, "Cant Post") self.queue.task_done() else: print ("Do Nothing") self.signal.emit(ids, "Do Nothing") self.queue.task_done() else: self.signal.emit(ids, "Cant Login") self.queue.task_done() else: vbbc = vbb.VbbPoster(self.session) login = vbbc.login(link, username, password) if login: if upbox == "Yes" and self.reply: # Reply thread here print ("reply to: %s" % link) vbbc.reply_thread(link, self.subject, self.data) self.signal.emit(ids, "Reply OK") self.queue.task_done() elif upbox == "No": post = vbbc.create_thread(link, self.subject, self.data) if post: xxxxx = self.session.open(link, header=headers) if self.subject in xxxxx.content: self.signal.emit(ids, "Done") self.queue.task_done() else: self.signal.emit(ids, "Post Failed") self.queue.task_done() else: self.signal.emit(ids, "Cant Post") self.queue.task_done() else: print ("Do Nothing") self.signal.emit(ids, "Do Nothing") self.queue.task_done() else: self.signal.emit(ids, "Cant Login") self.queue.task_done() # Xenforo # ******************************************************************************************* elif "Forum software by XenForo" in self.html.content or 'id="XenForo"' in self.html.content: print "Xenforo" xenforox = xenforo.Xenforo(self.session) login = xenforox.login(link, username, password) if login: if upbox == "Yes" and self.reply: print ("Reply to : %s" % link) # ***** Reply thread here ****** xenforox.reply_thread(link, self.data) self.signal.emit(ids, "Reply OK") self.queue.task_done() elif upbox == "No": post = xenforox.create_thread(link, self.subject, self.data) if post: xxxxx = self.session.open(link, header=headers) if self.subject in xxxxx.content: self.signal.emit(ids, "Done") self.queue.task_done() else: self.signal.emit(ids, "Post Failed") self.queue.task_done() else: self.signal.emit(ids, "Cant Post") self.queue.task_done() else: print ("Do Nothing") self.signal.emit(ids, "Do Nothing") self.queue.task_done() else: self.signal.emit(ids, "Cant Login") self.queue.task_done() # MyBB # ***************************************************************************** elif 'href="http://www.mybb.com"' in self.html.content: print "MyBB" mybbx = mybb.MyBB(self.session) login = mybbx.login(link, username, password) if login: if upbox == "Yes" and self.reply: # Reply thread here ################################ mybbx.reply_thread(link, self.data) self.signal.emit(ids, "Reply OK") self.queue.task_done() elif upbox == "No": post = mybbx.create_thread(link, self.subject, self.data) if post: xxxxx = self.session.open(link, header=headers) if self.subject in xxxxx.content: self.signal.emit(ids, "Done") self.queue.task_done() else: self.signal.emit(ids, "Post Failed") self.queue.task_done() else: self.signal.emit(ids, "Cant Post") self.queue.task_done() else: print ("Do Nothing") self.signal.emit(ids, "Do Nothing") self.queue.task_done() else: self.signal.emit(ids, "Cant Login") self.queue.task_done() # IP.BOARD # ********************************************************************************* elif "IP.Board" in self.html.content or "Powered By IP.Board" in self.html.content: print "IP.Board" self.signal.emit(ids, "Not Supported Yet") self.queue.task_done() # ipboardx = ipboard.IpBoard(self.session) # login = ipboardx.login(link, username, password) # if login: # if upbox == 'Yes' and self.reply: # # Reply thread here ############################ # pass # elif upbox == 'No': # post = ipboardx.create_thread(link, self.subject, self.data) # if post: # xxxxx = self.session.open(link, header=headers) # if self.subject in xxxxx.content: # self.signal.emit(ids, 'Done') # self.queue.task_done() # else: # self.signal.emit(ids, 'Post Failed') # self.queue.task_done() # else: # self.signal.emit(ids, 'Cant Post') # self.queue.task_done() # else: # print('Do Nothing') # self.signal.emit(ids, "Do Nothing") # self.queue.task_done() # else: # self.signal.emit(ids, "Cant Login") # self.queue.task_done() # # # phpBB # # ******************************************************************************* elif ( 'href="https://www.phpbb.com/"' in self.html.content or "phpBB Limited" in self.html.content or 'id="phpbb"' in self.html.content ): self.signal.emit(ids, "Not Supported Yet") self.queue.task_done() phpbbx = phpbb.PhpBB(self.session) login = phpbbx.login(link, username, password) if login: if upbox == "Yes" and self.reply: # Reply thread here **** pass elif upbox == "No": post = phpbbx.create_thread(link, self.subject, self.data) if post: xxxxx = self.session.open(link, header=headers) if self.subject in xxxxx.content: self.signal.emit(ids, "Done") self.queue.task_done() else: self.signal.emit(ids, "Post Failed") self.queue.task_done() else: self.signal.emit(ids, "Cant Post") self.queue.task_done() else: print ("Do Nothing") self.signal.emit(ids, "Do Nothing") self.queue.task_done() else: self.signal.emit(ids, "Cant Login") self.queue.task_done() # # SIMPLE MACHINE FORUM # # ********************* elif ( "simple, machines, forum" in html.content or "Powered by SMF" in html.content or "Simple Machines" in html.content ): print ("Simple Machines LLC") self.signal.emit(ids, "Not Supported Yet") self.queue.task_done() # smf = simplemachine.SimpleMachine(self.session) # login = smf.login(link, username, password) # if login: # if upbox == 'Yes' and self.reply: # ##################################### # pass # elif upbox == 'No': # post = smf.create_thread(link, self.subject, self.data) # if post: # xxxxx = self.session.open(link, header=headers) # if self.subject in xxxxx.content: # self.signal.emit(ids, 'Done') # self.queue.task_done() # else: # self.signal.emit(ids, 'Post Failed') # self.queue.task_done() # else: # self.signal.emit(ids, 'Cant Post') # self.queue.task_done() # else: # print('Do Nothing') # self.signal.emit(ids, "Do Nothing") # self.queue.task_done() # else: # self.signal.emit(ids, "Cant Login") # self.queue.task_done() # # Discuz forum # ************* elif ( '<a href="http://www.discuz.net"' in self.html.content or "Discuz!</a>" in self.html.content or "http://www.discuz.net" in self.html.content ): disc = discuz.Discuz(self.session) login = disc.login(link, username, password) if login: if upbox == "Yes" and self.reply: # Reply thread here **** disc.reply_thread(link, self.data) self.signal.emit(ids, "Reply OK") self.queue.task_done() elif upbox == "No": post = disc.create_thread(link, self.subject, self.data) if post: xxxxx = self.session.open(link, header=headers) if self.subject in xxxxx.content: self.signal.emit(ids, "Done") self.queue.task_done() else: self.signal.emit(ids, "Post Failed") self.queue.task_done() else: self.signal.emit(ids, "Cant Post") self.queue.task_done() else: print ("Do Nothing") self.signal.emit(ids, "Do Nothing") self.queue.task_done() else: self.signal.emit(ids, "Cant Login") self.queue.task_done() # ****************************************************************************************************** else: self.signal.emit(ids, "Cant Detect Forum's Type !") self.queue.task_done() else: print "Error" break if self.queue.empty(): break
class PostThead(QThread): def __init__(self, queue, model, status, sock, proxy): super(PostThead, self).__init__(None) self.queue = queue self.session = Rqbrowser() self.model = model if sock: self.session.set_proxies(sock5=sock) if proxy: self.session.set_proxies(proxy=proxy) self.status = status self.dic = {'vbb': 'bulletin_html'} self.subject = open('subject.txt').read() self.data = open('data.txt').read() self.html = None def run(self): while True: item = self.queue.get() if item is None: break # reached end of queue link = item[1] username = item[3] password = item[4] # Sleep against stuck thread. time.sleep(random.randint(100, 500) / 1000.0) print 'Go to %s' % link try: html = self.session.open(link, header=headers, timeout=15) self.html = html except requests.ConnectionError: print 'Cant connect requests' self.status.update({item[0]: 'Connection timeout !'}) self.queue.task_done() print self.html if self.html is not None: if 'javhug' in link or 'javdmm' in link: print 'Our blog Site' if 'vBulletin' in self.html.content\ or 'vbulletin_html' in self.html.content: print 'VBB' vbbc = vbb.VbbPoster(self.session) login = vbbc.login(link, username, password) if login: vbbc.create_thread(link, self.subject, self.data) self.status.update({item[0]: 'Done'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant Post'}) self.queue.task_done() elif 'Forum software by XenForo' in self.html.content or 'id="XenForo"' in self.html.content: print "Xenforo" xenforox = xenforo.Xenforo(self.session) login = xenforox.login(link, username, password) if login: poster = xenforox.reply_thread(link, self.data) if poster: self.status.update({item[0]: 'Done'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant Post'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant Login'}) self.queue.task_done() elif 'Power by MyBB' in self.html.content: print 'VBB' mybbx = mybb.MyBB(self.session) login = mybbx.login(link, username, password) if login: mybbx.create_thread(link, self.subject, self.data) self.status.update({item[0]: 'Done'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant Post'}) self.queue.task_done() elif 'IP.Board' in self.html.content or 'Powered By IP.Board' in self.html.content: print 'IP.Board' ipboardx = ipboard.IpBoard(self.session) login = ipboardx.login(link, username, password) if login: ipboardx.create_thread(link, self.subject, self.data) self.status.update({item[0]: 'Done'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant Post'}) self.queue.task_done() elif '<a href="https://www.phpbb.com/">phpBB</a>' in self.html.content \ or '® Forum Software © phpBB Limited' in self.html.content \ or 'id="phpbb"' in self.html.content: phpbbx = phpbb.PhpBB(self.session) login = phpbbx.login(link, username, password) if login: phpbbx.create_thread(link, self.subject, self.data) self.status.update({item[0]: 'Done'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant Post'}) self.queue.task_done() else: self.status.update({item[0]: 'Cant detect type !'}) print('Can not detect type of this forum !') self.queue.task_done() else: print 'Error' break if self.queue.empty(): break