-
Notifications
You must be signed in to change notification settings - Fork 1
/
github_views.py
176 lines (163 loc) · 6.15 KB
/
github_views.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import json
import time
import os
import random
import string
import ctypes
try:
import pystyle
import colored
import requests
import tls_client
import threading
import httpx
import datetime
except ModuleNotFoundError:
os.system('pip install pystyle')
os.system('pip install colored')
os.system('pip install requests')
os.system('pip install tls_client')
os.system('pip install threading')
os.system('pip install httpx')
os.system('pip install datetime')
from colored import fg
from pystyle import Write, System, Colors, Colorate
from tls_client import Session
from string import digits
lock = threading.Lock()
proxy_count = len(open('proxies.txt').readlines())
blue = fg(6)
reset = fg(7)
red = fg(1)
green = fg(2)
purple = fg(5)
pink = fg(216)
yellow = fg(226)
gray = fg(250)
views_sent = 0
def get_time_rn():
date = datetime.datetime.now()
hour = date.hour
minute = date.minute
second = date.second
timee = "{:02d}:{:02d}:{:02d}".format(hour, minute, second)
return timee
def save_proxies(proxies):
with open("proxies.txt", "w") as file:
file.write("\n".join(proxies))
def get_proxies():
with open('proxies.txt', 'r', encoding='utf-8') as f:
proxies = f.read().splitlines()
if not proxies:
proxy_log = {}
else:
proxy = random.choice(proxies)
proxy_log = {
"http://": f"http://{proxy}", "https://": f"http://{proxy}"
}
try:
url = "https://api.proxyscrape.com/v2/?request=getproxies&protocol=http&timeout=10000&country=all"
time_rn = get_time_rn()
response = httpx.get(url, proxies=proxy_log, timeout=60)
if response.status_code == 200:
proxies = response.text.splitlines()
save_proxies(proxies)
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}Proxy-Worker{reset} ] Success {purple}>{green} Scrapped Proxies {reset}[{pink} Total : {len(proxies)} {reset}]")
else:
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}Proxy-Worker{reset} ] Error {purple}>{red} Failed Getting Proxies...")
time.sleep(3)
get_proxies()
except httpx.ProxyError:
pass
except httpx.ReadError:
pass
except httpx.ConnectTimeout:
pass
except httpx.ReadTimeout:
pass
except httpx.ConnectError:
pass
except httpx.ProtocolError:
pass
def check_proxy_count():
with open("proxies.txt", "r") as file:
lines = file.readlines()
proxy_count = len(lines)
time_rn = get_time_rn()
if proxy_count < 105:
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}Proxy-Worker{reset} ] Warning {purple}>{yellow} You're close to running out of proxies.")
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}Proxy-Worker{reset} ] Re-Fill {purple}>{yellow} Filling proxies.txt with fresh and new proxies...")
time.sleep(1.5)
get_proxies()
else:
pass
def view_booster():
check_proxy_count()
thread_name = threading.currentThread().getName()
with open("config.json") as f:
data = json.load(f)
github_link = data.get('github_link')
global views_sent
while True:
ctypes.windll.kernel32.SetConsoleTitleW(f'Github Profile View Booster | By H4cK3dR4Du#0001 | Views Sent : {views_sent}')
date = datetime.datetime.now()
hour = date.hour
minute = date.minute
second = date.second
time_rn = "{:02d}:{:02d}:{:02d}".format(hour, minute, second)
with open('proxies.txt', 'r', encoding='utf-8') as f:
proxies = f.read().splitlines()
if not proxies:
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}{thread_name}{reset} ] Error {purple}>{red} No Proxy Found!")
proxy_log = {}
else:
proxy = random.choice(proxies)
proxy_log = {
"http://": f"http://{proxy}", "https://": f"http://{proxy}"
}
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}{thread_name}{reset} ] Loaded Proxy {purple}>{reset} {proxy}")
try:
response = httpx.get(github_link, proxies=proxy_log, timeout=20)
if response.status_code == 200:
date = datetime.datetime.now()
hour = date.hour
minute = date.minute
second = date.second
time_rn = "{:02d}:{:02d}:{:02d}".format(hour, minute, second)
views_sent += 1
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}{thread_name}{reset} ] Success {purple}>{green} Sent View {reset}[{pink} Total : {views_sent} {reset}]")
else:
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}{thread_name}{reset} ] Error {purple}>{red} Bad Gateaway 502")
except httpx.ProxyError:
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}{thread_name}{reset} ] Bad Proxy {purple}> {red}{proxy} {reset}| [{pink}REMOVED{reset}]")
with open('proxies.txt', 'r') as f:
lines = f.readlines()
with open('proxies.txt', 'w') as f:
for line in lines:
if proxy not in line:
f.write(line)
except httpx.ReadError:
continue
except httpx.ConnectTimeout:
continue
except httpx.ReadTimeout:
continue
except httpx.ConnectError:
continue
except httpx.ProtocolError:
continue
except ValueError:
print(f"{reset}{time_rn} {pink}| {reset}[ {pink}{thread_name}{reset} ] Error {purple}> {red}Invalid Github Camo Link...")
def run():
while True:
view_booster()
with open("config.json") as f:
data = json.load(f)
num_threads = data.get('threads', 250)
threads = []
for i in range(int(num_threads)):
thread = threading.Thread(target=run, name=f"VIEW_BOOSTER-{i+1}")
threads.append(thread)
thread.start()
for thread in threads:
thread.join()