Compare commits

..

8 Commits

Author SHA1 Message Date
e1e5560256 added winningslog if luckypot was claimed in this run 2023-04-20 09:51:20 +02:00
d65dd6541b added Winnings.txt to gitignore 2023-04-08 11:16:10 +02:00
d4b0fe9e31 fixed: search honeygainlogin.json in script folder
fixed: Add your Winnings logfile to script folder
commented out the while loop for not enough traffic. (__lottie_elemtent_2" is always present)
2023-04-08 11:15:52 +02:00
a97d3475c5 added possibility to add userdata on start, added argument -s --setup switch, added colored output, added Winnings log with date output for better stats 2023-03-20 00:48:51 +01:00
d269c3dc10 added base honeygainlogin.json 2023-03-20 00:04:25 +01:00
25a930f0ab Merge remote-tracking branch 'origin/main' 2023-03-20 00:00:07 +01:00
4a41b0afc2 added package relevant stuff to gitignore 2023-03-19 23:59:58 +01:00
6af4fb38b2 added package relevant stuff to gitignore 2023-03-19 23:59:43 +01:00
3 changed files with 109 additions and 18 deletions

4
.gitignore vendored
View File

@@ -2,3 +2,7 @@ honeygainlogin.json
build/
dist/
claim.log
package.sh
honeygaingift.spec
output/
Winnings.txt

View File

@@ -4,6 +4,8 @@ import time
import logging
import requests
import platform
import argparse
import datetime
import subprocess
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
@@ -12,6 +14,46 @@ from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.action_chains import ActionChains
def print_color(message, color):
colors = {
'black': '\033[30m',
'red': '\033[31m',
'green': '\033[32m',
'yellow': '\033[33m',
'blue': '\033[34m',
'purple': '\033[35m',
'cyan': '\033[36m',
'white': '\033[37m'
}
end_color = '\033[0m'
print(f"{colors[color]}{message}{end_color}")
def get_login_data():
username = input("Gebe deine Honeygain Mailadresse ein: ")
password = input("Gebe dein Honeygain passwort ein: ")
login_data = {"username": username, "password": password}
with open('honeygainlogin.json', 'w') as file:
json.dump(login_data, file)
return login_data
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--setup', action='store_true', help='set up Honeygain login credentials')
args = parser.parse_args()
if args.setup:
login_data = get_login_data()
write_userdata = input("Möchtest du den Honeypot Claimer nun ausführen? [Y/n] ").lower()
if write_userdata == "" or write_userdata == "y":
# continue with the default action
pass
elif write_userdata == "n":
# take alternative action
print_color("Deine Daten wurden gespeichert...", 'green')
sys.exit()
else:
# handle invalid input
print_color("Invalid input, please try again.", 'red')
# Hier wird das logging erstmal auf Critical gestellt
logging.basicConfig(level=logging.CRITICAL)
@@ -31,9 +73,33 @@ logger = logging.getLogger()
# Stelle das Log Level ein
logger.setLevel(logging.INFO)
login_file = os.path.join(script_dir, 'honeygainlogin.json')
winnings_log = os.path.join(script_dir, 'Winnings.txt')
# Lade die Logindaten aus der honeygainlogin.json datei.
with open('honeygainlogin.json', 'r') as file:
try:
with open(login_file, 'r') as file:
login_data = json.load(file)
except FileNotFoundError:
print_color("FEHLER! Die honeygainlogin.json konnte nicht gefunden werden.", 'red')
login_data = {"username": "user@mail.com", "password": "p@ssw0rd"}
with open(login_file, 'w') as file:
json.dump(login_data, file)
quit()
if login_data['username'] == 'user@mail.com' or login_data['password'] == 'p@ssw0rd':
print_color("FEHLER! Bitte gebe deine Logindaten noch in der honeygainlogin.json ein!", 'red')
write_userdata = input("Möchtest du deine Userdaten jetzt aktualisieren? [Y/n] ").lower()
if write_userdata == "" or write_userdata == "y":
# continue with the default action
get_login_data()
elif write_userdata == "n":
# take alternative action
print_color("Breche vorgang ab...", 'red')
quit()
else:
# handle invalid input
print_color("Invalid input, please try again.", "red")
username = login_data['username']
password = login_data['password']
@@ -102,19 +168,19 @@ cookie_button = driver.find_element(By.XPATH, "//button[contains(., 'Accept sele
cookie_button.click()
# Zunächst überprüfen wir, ob wir schon genug Traffic zum claimen erzeugt haben
while True:
try:
time.sleep(5)
traffic = driver.find_element(By.ID, "__lottie_element_2")
traffic_element = driver.find_element(By.XPATH, "//span[contains(text(), 'MB')]")
traffic_text = traffic_element.text
print(f"Es wurde noch nicht genug traffic erzeugt ({traffic_text}) von 15 MB")
print('Warte 60 Minuten und versuche es erneut')
time.sleep(3600)
driver.get(driver.current_url)
except:
# Element not found, do something else
break
#while True:
# try:
# time.sleep(5)
# traffic = driver.find_element(By.ID, "__lottie_element_2")
# traffic_element = driver.find_element(By.XPATH, "//span[contains(text(), 'MB')]")
# traffic_text = traffic_element.text
# print(f"Es wurde noch nicht genug traffic erzeugt ({traffic_text}) von 15 MB")
# print('Warte 60 Minuten und versuche es erneut')
# time.sleep(3600)
# driver.get(driver.current_url)
# except:
# # Element not found, do something else
# break
# Versuche einen Timer ausfindig zu machen
try:
@@ -147,6 +213,16 @@ try:
winnings_str = str(winnings_int)
# Zeige eine Nachricht mit den Credits die heute gewonnen wurden.
print('Du hast heute', winnings_str ,'Credits (', winnings_in_dollars, '$) gewonnen.')
winningslog = f"Es wurden {winnings_str} Credits ({winnings_in_dollars} $) gewonnen."
today = datetime.datetime.now().strftime("%d.%m.%Y")
try:
with open(winnings_log, 'r+') as file:
contents = file.read()
if today not in contents:
file.write(f"{today} - {winningslog}\n")
except FileNotFoundError:
with open(winnings_log, 'w') as file:
file.write(f"{today} - {winningslog}\n")
else:
print('Error:', response.status_code, response.text)
except TimeoutException:
@@ -175,6 +251,17 @@ except TimeoutException:
winnings_str = str(winnings_int)
# Zeige eine Nachricht mit den Credits die heute gewonnen wurden.
print('Der LuckyPot wurde erfolgreich geclaimed! Du hast', winnings_str ,'Credits (', winnings_in_dollars, '$) gewonnen.')
winningslog = f"Es wurden {winnings_str} Credits ({winnings_in_dollars} $) gewonnen."
today = datetime.datetime.now().strftime("%d.%m.%Y")
try:
with open(winnings_log, 'r+') as file:
contents = file.read()
if today not in contents:
file.write(f"{today} - {winningslog}\n")
except FileNotFoundError:
with open(winnings_log, 'w') as file:
file.write(f"{today} - {winningslog}\n")
except TimeoutException:
print("The 'Open Lucky Pot' button was not found within 10 seconds. Exiting...")

View File

@@ -1,5 +1,5 @@
{
"username": "",
"password": ""
"username": "user@mail.com",
"password": "p@ssw0rd"
}