/
main.py
119 lines (103 loc) · 5.39 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
from colors import green, red, reset
import threading
import requests
import random
import string
import sys
import os
from time import sleep
os.system('title [Lightshot Brute Force] - Scrape Screenshots ^| Loading...')
logo = '''
▄▄▄▄ ██▀███ █ ██ ▄▄▄█████▓▓█████ █████▒▒█████ ██▀███ ▄████▄ ▓█████
▓█████▄ ▓██ ▒ ██▒ ██ ▓██▒▓ ██▒ ▓▒▓█ ▀ ▓██ ▒▒██▒ ██▒▓██ ▒ ██▒▒██▀ ▀█ ▓█ ▀
▒██▒ ▄██▓██ ░▄█ ▒▓██ ▒██░▒ ▓██░ ▒░▒███ ▒████ ░▒██░ ██▒▓██ ░▄█ ▒▒▓█ ▄ ▒███
▒██░█▀ ▒██▀▀█▄ ▓▓█ ░██░░ ▓██▓ ░ ▒▓█ ▄ ░▓█▒ ░▒██ ██░▒██▀▀█▄ ▒▓▓▄ ▄██▒▒▓█ ▄
░▓█ ▀█▓░██▓ ▒██▒▒▒█████▓ ▒██▒ ░ ░▒████▒ ░▒█░ ░ ████▓▒░░██▓ ▒██▒▒ ▓███▀ ░░▒████▒
░▒▓███▀▒░ ▒▓ ░▒▓░░▒▓▒ ▒ ▒ ▒ ░░ ░░ ▒░ ░ ▒ ░ ░ ▒░▒░▒░ ░ ▒▓ ░▒▓░░ ░▒ ▒ ░░░ ▒░ ░
▒░▒ ░ ░▒ ░ ▒░░░▒░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ▒░ ░▒ ░ ▒░ ░ ▒ ░ ░ ░
░ ░ ░░ ░ ░░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
'''
print('%s%s' % (green(), logo))
if not os.path.exists('Images'):
os.makedirs('Images')
valid = 0
invalid = 0
retries = 0
proxies = []
proxy_num = 0
lock = threading.Lock()
headers = {
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
}
def grab_proxies():
while True:
all_proxies = requests.get(
'https://api.proxyscrape.com/?request=getproxies&proxytype=http&timeout=5000&country=all&ssl=all&anonymity=all').text
for proxy in all_proxies.splitlines():
proxies.append(proxy)
sleep(600)
proxies.clear()
def cpm():
old = valid + invalid
sleep(1)
new = valid + invalid
return ((new - old) * 60)
def save(arg):
content = requests.get(arg).content
if 'image.prntscr' in arg:
half_url = 'https://image.prntscr.com/image/'
elif 'i.imgur' in arg:
half_url = 'https://i.imgur.com/'
with open('Images/' + arg.replace(half_url, '')[:6] + '.png', 'wb') as f:
f.write(content)
def main(proxy):
global valid
global invalid
global retries
code = ''.join(random.choice(string.ascii_lowercase + string.digits)
for _ in range(6))
try:
check = requests.get('https://prnt.sc/%s' % (code), headers=headers,
proxies={'https': 'http://%s' % (proxy)}).text
except:
retries += 1
os.system('title [Lightshot Brute Force] - Scrape Screenshots ^| Checked: %s ^| Valid: %s ^| Invalid: %s ^| Retries: %s ^| CPM: %s' %
(valid + invalid, valid, invalid, retries, cpm()))
else:
if 'name="twitter:image:src" content="' in check and not '0_173a7b_211be8ff' in check and not 'ml3U3Pt' in check:
lock.acquire()
sys.stdout.write('[%sVALID%s] https://prnt.sc/%s\n' %
(green(), reset(), code))
lock.release()
valid += 1
os.system('title [Lightshot Brute Force] - Scrape Screenshots ^| Checked: %s ^| Valid: %s ^| Invalid: %s ^| Retries: %s ^| CPM: %s' %
(valid + invalid, valid, invalid, retries, cpm()))
url = check.split('name="twitter:image:src" content="')[
1].split('"/> <meta')[0]
save(url)
with open('Image Links.txt', 'a', encoding='UTF-8') as f:
f.write('https://prnt.sc/%s\n' % (code))
else:
lock.acquire()
sys.stdout.write('[%sINVALID%s] https://prnt.sc/%s\n' %
(red(), reset(), code))
lock.release()
invalid += 1
os.system('title [Lightshot Brute Force] - Scrape Screenshots ^| Checked: %s ^| Valid: %s ^| Invalid: %s ^| Retries: %s ^| CPM: %s' %
(valid + invalid, valid, invalid, retries, cpm()))
threading.Thread(target=grab_proxies).start()
threading.Thread(target=cpm).start()
sleep(3)
while True:
if threading.active_count() <= 200:
try:
threading.Thread(target=main, args=(proxies[proxy_num],)).start()
proxy_num += 1
if proxy_num >= len(proxies):
proxy_num = 0
except:
pass