Advertisement
Guest User

prnt.sc

a guest
Jan 8th, 2020
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup as BS
  3. import string
  4. import random
  5. from contextlib import suppress
  6. import ctypes
  7.  
  8.  
  9. name = ""
  10. urlcislo = 16
  11. bad = 0
  12. good = 0
  13. headers = {
  14. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.71'
  15. }
  16.  
  17. def randomString(stringLength=2):
  18. letters = string.ascii_lowercase
  19. return ''.join(random.choice(letters) for i in range(stringLength))
  20.  
  21. while True:
  22. try:
  23. with requests.Session() as s:
  24. url = 'https://prnt.sc/' + randomString() + str(random.randint(100,999))
  25. r = s.get(url, headers=headers)
  26.  
  27. soup = BS(r.content, 'html.parser')
  28. img_url = soup.find('img', {'id': 'screenshot-image'})['src']
  29. lmao = len(url) - 16
  30. for i in range(lmao):
  31.  
  32. name = name + url[urlcislo]
  33. urlcislo = urlcislo + 1
  34. urlcislo = 16
  35.  
  36. r = s.get(img_url, headers=headers)
  37. with open("screen/" + name + ".png", "wb") as f:
  38. f.write(r.content)
  39. print(name + " is working! 1")
  40. good +=1
  41. ctypes.windll.kernel32.SetConsoleTitleW("Good: " + str(good) + " Bad: " + str(bad) + " | By: noskin9782")
  42. name = ""
  43. except Exception:
  44. print(name + " failed :( 0")
  45. bad +=1
  46. ctypes.windll.kernel32.SetConsoleTitleW("Good: " + str(good) + " Bad: " + str(bad) + " | By: noskin9782")
  47. name = ""
  48. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement