diff --git a/AVR_Miner.py b/AVR_Miner.py index b6c2b514..5e088e40 100644 --- a/AVR_Miner.py +++ b/AVR_Miner.py @@ -18,7 +18,7 @@ from pathlib import Path from json import load as jsonload -import json +from random import choice from locale import LC_ALL, getdefaultlocale, getlocale, setlocale import zipfile @@ -271,14 +271,14 @@ def check_mining_key(user_settings): user_settings = user_settings["AVR Miner"] if user_settings["mining_key"] != "None": - key = b64.b64decode(user_settings["mining_key"]).decode('utf-8') + key = "&k=" + b64.b64decode(user_settings["mining_key"]).decode('utf-8') else: key = '' response = requests.get( "https://server.duinocoin.com/mining_key" + "?u=" + user_settings["username"] - + "&k=" + key, + + key, timeout=10 ).json() diff --git a/PC_Miner.py b/PC_Miner.py index 1a30d10f..862d07d0 100644 --- a/PC_Miner.py +++ b/PC_Miner.py @@ -648,14 +648,14 @@ def get_string(string_name): def check_mining_key(user_settings): if user_settings["mining_key"] != "None": - key = b64.b64decode(user_settings["mining_key"]).decode('utf-8') + key = '&k=' + b64.b64decode(user_settings["mining_key"]).decode('utf-8') else: key = '' response = requests.get( "https://server.duinocoin.com/mining_key" + "?u=" + user_settings["username"] - + "&k=" + key, + + key, timeout=Settings.SOC_TIMEOUT ).json() @@ -676,6 +676,7 @@ def check_mining_key(user_settings): pretty_print(get_string("mining_key_required"), "warning") mining_key = input("\t\t" + get_string("ask_mining_key") + Style.BRIGHT + Fore.YELLOW) + if mining_key == "": mining_key = "None" #replace empty input with "None" key user_settings["mining_key"] = b64.b64encode( mining_key.encode("utf-8")).decode('utf-8') configparser["PC Miner"] = user_settings @@ -691,6 +692,7 @@ def check_mining_key(user_settings): retry = input(get_string("key_retry")) if not retry or retry == "y" or retry == "Y": mining_key = input(get_string("ask_mining_key")) + if mining_key == "": mining_key = "None" #replace empty input with "None" key user_settings["mining_key"] = b64.b64encode( mining_key.encode("utf-8")).decode('utf-8') configparser["PC Miner"] = user_settings