zeerx7

Get big web list

Feb 11th, 2021 (edited)
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.08 KB | None | 0 0
  1. #@Zeerx7
  2. import requests, json
  3. from multiprocessing import Pool
  4. from multiprocessing.dummy import Pool as ThreadPool
  5. class Pausi(object):
  6.         """docstring for Pausi"""
  7.         def __init__(self, key, displays=''):
  8.                 self.url = 'http://104.42.122.163/api.php?key='+key
  9.                 if displays:self.displays = True
  10.                 else:self.displays = False
  11.                 self.save = open('weblist.txt', 'a')
  12.                 self.main()
  13.         def main(self):
  14.                 req = requests.get(self.url)
  15.                 if req.status_code == 200 and req.text:
  16.                         res = json.loads(req.text)
  17.                         if res['msg']:
  18.                                 print res['msg']
  19.                         else:
  20.                                 for x in res['urls']:
  21.                                         if self.displays:print x
  22.                                         else:pass
  23.                                         self.save.write(x+'\n')
  24.                                 jum = len(res['urls'])
  25.                                 print "managed to get {} urls".format(jum)
  26.  
  27. class Main(object):
  28.         """docstring for Main"""
  29.         def __init__(self):
  30.                 self.main()
  31.         def main(self):
  32.                 print '''
  33. --- Coded by Zeerx7 ---
  34. +++   XploitSec-ID  +++
  35.  
  36. 1. Get Weblist
  37. 2. Remove Duplicate Sites
  38.                '''
  39.                 inp = input('Select:: ')
  40.                 try:
  41.                         if inp == 1:
  42.                                 se = raw_input("show all results? [Y/n]")
  43.                                 if se == 'Y' or se == 'y':disp = True
  44.                                 else:disp = False
  45.                                 threadss = input('Thread:: ')
  46.                                 print "your results will be saved in :: weblist.txt"
  47.                                 thr = []
  48.                                 for x in range(threadss):
  49.                                         thr.append('public')
  50.                                 while True:
  51.                                         pool = ThreadPool(len(thr))
  52.                                         pool.map(Pausi, thr)
  53.                                         pool.close()
  54.                                         pool.join()
  55.                                         #Pausi(key='public', displays=disp)
  56.                         elif inp == 2:
  57.                                 self.remove_duplicate()
  58.                 except:
  59.                         pass
  60.         def remove_duplicate(self):
  61.                 tmp = []
  62.                 lists = raw_input('Your list: ')
  63.                 save = raw_input('Save Name: ')
  64.                 sv = open(save,'a')
  65.                 with open(lists) as fileobject:
  66.                     for x in fileobject:
  67.                         x = x.strip()
  68.                         if x in tmp:
  69.                                 print x+" Duplicate Url"
  70.                         else:
  71.                                 tmp.append(x)
  72.                                 sv.write(x+'\n')
  73.                                 print x+" OK"
  74.  
  75. Main()
Add Comment
Please, Sign In to add comment