import datetime
import random
import threading
import requests
import time
import os
# MiningPH Bot Settings
#########################################################################################################
# User Settings #
USER_ID = "1328685" #
xVal = "1" #
yVal = "1000000" #
cøøkíéS_COMPLETE = False #
cøøkíéS = { #
"__cfduid" : "d39927d30f431c556797fdf499b0ed5dc1586496955", #
"__cf_bm" : "f02aa2cfb75ffe4fc1f9c002752ebe452c9f33d1-1586515923-1800-AYCumt4VyHgeaDXN4ufTeaORceEHYw2W58IftXWAR/DgbTd/S+p7z0Ygj04T+SgZN8BpMgAfmfAUV3nW0DLfBMk=", #
"ci_session" : "1bu2ho6son6btm1idqu28bkkp2m3sm23", #
"hashes" : "100",} #
URL = "https://miningph.com/application/views/user/getHashes.php?xVal={x}&id={id}&yVal={y}".format( #
x=xVal, id=USER_ID, y=yVal) #
# ----------------------------------------------------------------------------------------------------- #
# System Settings #
HEADERS = { #
"Host": "miningph.com", #
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0", #
"Accept": "*/*", #
"Accept-Language": "en-US,en;q=0.5", #
"Accept-Encoding": "gzip, deflate, br", #
"X-Requested-With": "XMLHttpRequest", #
"DNT": "1", #
"Connection": "keep-alive", #
"Referer": "https://miningph.com/miner?e={e}".format(e=USER_ID), #
#
"TE": "Trailers"} #
#########################################################################################################
global totalBots
global totalHits
global totalErrors
totalBots = 0
totalHits = 0
totalErrors = 0
def main():
global totalHits
global totalErrors
with requests.Session() as s:
try:
r = s.get(URL, headers=HEADERS, cøøkíés=cøøkíéS)
totalHits += 1
except (AttributeError, urllib3.exceptions.ProtocolError, requests.exceptions.SSLError, RemoteDisconnected, OSError) as e:
totalErrors += 1
class thread_bot(threading.Thread):
global totalBots
global totalHits
def run(self):
while True:
main()
#print("Hits: {h}\nBots: {b}\n".format(h = totalHits, b = totalBots),end='\r')
class thread_print(threading.Thread):
global totalBots
global totalHits
global totalErrors
def run(self):
ptime = datetime.datetime.now()
while True:
phits = totalHits
time.sleep(1)
chits = totalHits - phits
ctime = datetime.datetime.now() - ptime
print("\nTime Elapsed: {t}\nHits: {h}\nHits per second: {c}\nErrors: {e}".format(h = totalHits, t = ctime, c=chits, e=totalErrors))
#print("\nHits: {h}\nHits per second: {c}".format(h = totalHits,c=chits))
def run():
bot2 = thread_print()
bot2.start()
for b in range(100):
global totalBots
totalBots += 1
bot = thread_bot()
bot.start()
if __name__ == "__main__":
run()