allow the use of a test google account

master
EmaMaker 2021-08-27 22:34:49 +02:00
parent 66d0617299
commit 5b0af63c49
3 changed files with 32 additions and 28 deletions

View File

@ -136,9 +136,6 @@ class QL_CreateAccount:
time.sleep(1000)
class RandomNameGenerator():
def __init__(self):
self.proxyDict = {

View File

@ -160,32 +160,37 @@ def get_google_account():
from utils import global_vars
import subprocess
print("[QL_GetAccount] Getting new google account..." )
account = global_vars.ql_list.request_new_account()
if not global_vars.TEST_ACCOUNT:
print("[QL_GetAccount] Getting new google account..." )
account = global_vars.ql_list.request_new_account()
res = subprocess.check_output(['bash','-c', "src/qwiklabs/get_account.sh {} {} ".format(str(global_vars.PROXY), account)]).decode('utf-8')
if res is False:
res = bool(res)
# Maybe if we failed there was a connection issue, so ping qwiklabs.com to check
# If ping is successful the account is out of quota
res = subprocess.check_output(['bash','-c', "src/qwiklabs/get_account.sh {} {} ".format(str(global_vars.PROXY), account)]).decode('utf-8')
if res is False:
res = bool(res)
# Maybe if we failed there was a connection issue, so ping qwiklabs.com to check
# If ping is successful the account is out of quota
if global_vars.PROXY is False:
r = requests.get("https://qwiklabs.com", proxies=proxyDict)
else :
proxyDict = {
"socksVersion" : 5,
"socks" : global_vars.PROXY
}
if global_vars.PROXY is False:
r = requests.get("https://qwiklabs.com", proxies=proxyDict)
else :
proxyDict = {
"socksVersion" : 5,
"socks" : global_vars.PROXY
}
r = requests.get("https://qwiklabs.com", proxies=proxyDict)
r = requests.get("https://qwiklabs.com", proxies=proxyDict)
# ping was unsuccessful, delete the account
if r.stats_code == 200:
print("[QL_GetAccount] Something went wrong, trying again")
else:
ql_list.mark_account_for_deletition(account)
# ping was unsuccessful, delete the account
if r.stats_code == 200:
print("[QL_GetAccount] Something went wrong, trying again")
return get_google_account()
else:
ql_list.mark_account_for_deletition(account)
print("[QL_GetGAccount] {}".format(res))
return res
else:
print("[QL_GetAccount] Using Test Account" )
return global_vars.TEST_ACCOUNT
print("[QL_GetGAccount] {}".format(res))
return res

View File

@ -1,4 +1,6 @@
from qwiklabs import account_list
PROXY = False
ql_list = account_list.QL_AccountList('/home/emamaker/Documents/Projects/GColabAutomator/GColabAutomator-v2/src/qwiklabs_available_accounts.txt')
ql_list = account_list.QL_AccountList('/home/emamaker/Documents/Projects/GColabAutomator/GColabAutomator-v2/src/qwiklabs_available_accounts.txt')
#TEST_ACCOUNT = False
TEST_ACCOUNT = ("student-03-0556d73e7330@qwiklabs.net", "S3jD9Cn6k5dpW")