Skip to content

Commit

Permalink
Update 1.2.1 By Lucky
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky1376 committed Nov 12, 2022
1 parent 17280e6 commit c15b8c8
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 11 deletions.
16 changes: 8 additions & 8 deletions tools/proxy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import requests, random, threading as th
from bs4 import BeautifulSoup as BS
from fake_useragent import UserAgent as UA
from progress.bar import ChargingBar
from tools.user_agents import r_ua

def SPC(ip, port, login=None, password=None):
ua = UA().random
ua = r_ua()
ipp = ip + ':' + port
proxy_http = {'http': 'http://' + ipp}

Expand Down Expand Up @@ -146,7 +146,7 @@ def get(self):
bar = ChargingBar('Парсинг', max = len(pr_b))

# User-Agent
ua = UA()
ua = r_ua()

# Summary sheet with proxy
itog = {}
Expand All @@ -161,7 +161,7 @@ def get(self):
for ct in url_list:
can = False
try:
response = requests.get(url_list[ct], headers={"User-Agent": ua.random}, timeout=self.timeout)
response = requests.get(url_list[ct], headers={"User-Agent": ua}, timeout=self.timeout)
can = True
except:
pass
Expand Down Expand Up @@ -193,7 +193,7 @@ def get(self):
# -----------------------------------------------
can = False
try:
response = requests.get("https://www.sslproxies.org", headers={"User-Agent": ua.random}, timeout=self.timeout)
response = requests.get("https://www.sslproxies.org", headers={"User-Agent": ua}, timeout=self.timeout)
can = True
except:
pass
Expand Down Expand Up @@ -230,7 +230,7 @@ def get(self):
if self.unknown == True:
can = False
try:
response = requests.get("https://api.proxyscrape.com/v2/?request=displayproxies&protocol=http&timeout=5000&country=all&ssl=all&anonymity=all", headers={"User-Agent": ua.random}, timeout=self.timeout)
response = requests.get("https://api.proxyscrape.com/v2/?request=displayproxies&protocol=http&timeout=5000&country=all&ssl=all&anonymity=all", headers={"User-Agent": ua}, timeout=self.timeout)
can = True
except:
pass
Expand All @@ -254,7 +254,7 @@ def get(self):
col_page = 1
can = False
try:
result = requests.get("https://proxylist.geonode.com/api/proxy-list?limit=50&page=1&sort_by=lastChecked&sort_type=desc&speed=medium&protocols=http%2Chttps", headers={"User-Agent": ua.random}, timeout=self.timeout)
result = requests.get("https://proxylist.geonode.com/api/proxy-list?limit=50&page=1&sort_by=lastChecked&sort_type=desc&speed=medium&protocols=http%2Chttps", headers={"User-Agent": ua}, timeout=self.timeout)
can = True
except:
pass
Expand All @@ -269,7 +269,7 @@ def get(self):
i = 1
while i < col_page:
try:
response = requests.get(f"https://proxylist.geonode.com/api/proxy-list?limit=50&page={i}&sort_by=lastChecked&sort_type=desc&speed=medium&protocols=http%2Chttps", headers={"User-Agent": ua.random}, timeout=15)
response = requests.get(f"https://proxylist.geonode.com/api/proxy-list?limit=50&page={i}&sort_by=lastChecked&sort_type=desc&speed=medium&protocols=http%2Chttps", headers={"User-Agent": ua}, timeout=15)
if response.status_code == 200:
for pr in response.json()["data"]:
ip = pr["ip"]
Expand Down
6 changes: 4 additions & 2 deletions tools/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
import requests
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
from tools.user_agents import r_ua

# services list
services_list = []
Expand Down Expand Up @@ -196,7 +196,7 @@ def spam(self, service, phone, proxy=None):
url = service["url"]

# generate headers
ua = UserAgent().random
ua = r_ua()
try:
service["headers"]["User-Agent"] = ua
headers = service["headers"]
Expand Down Expand Up @@ -254,5 +254,7 @@ def spam(self, service, phone, proxy=None):
return 200, r.text
else:
return r.status_code, r.text
except KeyboardInterrupt:
return False, "keyboard"
except Exception as e:
return False, e # https://t.me/orion_bomber
6 changes: 6 additions & 0 deletions tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ def start(number, country, proxy_=None):
if sender_class.checktimeout(serv) == True:
if proxy_ != None:
result = sender_class.spam(serv, number, proxy=proxy_["format"])
if result[1] == "keyboard":
raise KeyboardInterrupt

if result[0] == False:
logs.save_logs(serv, result[0], error=str(result[1]))
else:
Expand Down Expand Up @@ -763,6 +766,9 @@ def start(number, country, proxy_=None):
FormattingResponse(666, serv)
else:
result = sender_class.spam(serv, number)
if result[1] == "keyboard":
raise KeyboardInterrupt

if result[0] == False:
logs.save_logs(serv, result[0], error=str(result[1]))
else:
Expand Down
Loading

0 comments on commit c15b8c8

Please sign in to comment.