ignroe pyc files

This commit is contained in:
Karl0ss 2023-09-14 14:40:16 +01:00
parent a15c68daac
commit 0ef3916ae7
5 changed files with 78 additions and 24 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.env
*.pyc

Binary file not shown.

41
ktvmanager/lib/checks.py Normal file
View File

@ -0,0 +1,41 @@
import requests
import concurrent.futures
import time
from requests_tor import RequestsTor
import os
from dotenv import load_dotenv
from ktvmanager.lib.get_urls import generate_urls_for_user
import json
load_dotenv()
rt = RequestsTor(tor_ports=(9001, 9002, 9003, 9004, 9005), tor_cport=9051, password=os.getenv('TORSPWD'), autochange_id=3)
def get_status(url):
try:
resp = rt.get(url=url, timeout=2)
if resp.status_code == 200:
if "<html><head>" not in resp.text:
response_data = json.loads(resp.text)
if response_data['user_info']['auth'] == 1:
return response_data
except:
pass
def find_url_for_user_details(username, password):
urls = generate_urls_for_user(username, password)
tm1 = time.perf_counter()
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = []
for url in urls:
futures.append(executor.submit(get_status, url=url))
for future in concurrent.futures.as_completed(futures):
if future._result != None:
executor.shutdown(wait=False)
print(f"{future._result['user_info']['username']} - {future._result['server_info']['url']}:{future._result['server_info']['port']}")
tm2 = time.perf_counter()
print(f'Total time elapsed: {tm2-tm1:0.2f} seconds')
find_url_for_user_details('Karl061122', 'gkuEDWzxHD')
find_url_for_user_details('Karl130623', 'emYZWPs')
find_url_for_user_details('Karlos2306', 'Gg58Wg8MB9')
find_url_for_user_details('Maxine2306', 'EszFDNNcb2')

View File

@ -0,0 +1 @@
http://sarahgraphite.awardvpn.xyz

View File

@ -3,34 +3,45 @@ from dotenv import load_dotenv
import requests
import json
from requests_tor import RequestsTor
load_dotenv()
torpass = os.getenv('TORSPWD')
rt = RequestsTor(tor_ports=(9001, 9002, 9003, 9004, 9005), tor_cport=9051, password=torpass, autochange_id=1)
# check your ip
rt.check_ip()
url = 'https://httpbin.org/anything'
r = rt.get(url)
print(r.text)
rt = RequestsTor(tor_ports=(9001, 9002, 9003, 9004, 9005), tor_cport=9051, password=torpass, autochange_id=5)
with open('./ktvmanager/lib/DNS_list.txt') as f:
lines = [line.rstrip('\n') for line in f]
print(lines)
def get_latest_urls_from_dns():
with open('./ktvmanager/lib/DNS_list.txt') as f:
lines = [line.rstrip('\n') for line in f]
with open('./ktvmanager/lib/extra_urls.txt') as urls:
extra_urls = [line.rstrip('\n') for line in urls]
# print(lines)
hard_url = '/player_api.php?password=gkuEDWzxHD&username=Karl061122&action=user&sub=info'
complete_list_of_urls = []
complete_list_of_urls = []
for url in lines:
data = requests.get(url)
content = json.loads(data.text)
list_of_urls = content['su'].split(',')
for url in list_of_urls:
for url in lines:
data = requests.get(url)
content = json.loads(data.text)
list_of_urls = content['su'].split(',')
for url in list_of_urls:
complete_list_of_urls.append(url)
complete_list_of_urls = list(set(complete_list_of_urls))
# print(complete_list_of_urls)
for url in extra_urls:
complete_list_of_urls.append(url)
complete_list_of_urls = list(set(complete_list_of_urls))
print(complete_list_of_urls)
return complete_list_of_urls
def generate_urls_for_user(username, password):
new_urls = []
for url in get_latest_urls_from_dns():
hard_url = f'/player_api.php?password={password}&username={username}&action=user&sub=info'
new_url = url + hard_url
new_urls.append(new_url)
return new_urls
def check_for_url_from_details(username, password):
new_urls = []
for url in get_latest_urls_from_dns():
hard_url = f'/player_api.php?password={password}&username={username}&action=user&sub=info'
new_url = url + hard_url
new_urls.append(new_url)
print(new_urls)