Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import requests
- scraped = []
- postdata = {'archive_showMore':"asd"}
- cookie = {'__cfduid':'d16bf414ae86f6164895e75be36be2c7d1409791061228',
- 'cf_clearance':'eb76c50b00b6b1811f491e5648a2d12bbfec8811-1409790665-900',
- 'PHPSESSID':'ef65604d1e74a36527b77503c3cf8963'
- }
- headers = {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.102 Safari/537.36'
- }
- run = True
- print "[+] Started scraping"
- f = open('workfile', 'w')
- first = True
- cf_clearence = ""
- def in_array(array, compare0):
- exist = False
- for i in range(0, len(array)):
- if compare0[0] in array[i][0]:
- exist = True
- break
- return exist
- false = False
- while run == True:
- try:
- if first == True:
- r = requests.post("http://skidpaste.org/paste.cgi", headers=headers, cookies=cookie)
- if("Please turn JavaScript on and reload the page." in r):
- raise Exception("I\'m a skid")
- else:
- print "[+] Wurk c:"
- first = False
- else:
- r = requests.post("http://skidpaste.org/paste.cgi", headers=headers, cookies=cookie, data=postdata)
- except Exception:
- print "[-] no wurk :c"
- nowurk = True
- while(nowurk == True):
- try:
- if first == True:
- r = requests.post("http://skidpaste.org/paste.cgi", headers=headers, cookies=cookie)
- if("Please turn JavaScript on and reload the page." in r):
- print"[-] No wurk :C"
- else:
- print "[+] Wurk c:"
- nowurk = False
- first = False
- else:
- r = requests.post("http://skidpaste.org/paste.cgi", headers=headers, cookies=cookie, data=postdata)
- except Exception:
- print "[-] no wurk :c"
- regex = re.compile('<a href=(?:"|\')([a-zA-z0-9]{8})(?:"|\')>.*<\/a>')
- reg = regex.findall(r.text)
- for captures in reg:
- if in_array(scraped, captures[0]) == False:
- scraped.insert(len(scraped)+1, captures)
- print "[+] Found paste: " + captures
- print "[-] Stopped scraping"
Advertisement
Add Comment
Please, Sign In to add comment