Skip to content

Commit

Permalink
Telegram Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Xairooo authored Jul 31, 2017
1 parent 40dddd3 commit e9f22d7
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions MultiBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def getProxy():
if proxyCur >= proxyNum:
proxyCur = 0
headers = {'user-agent': 'Niantic App'}
if requests.get('https://pgorelease.nianticlabs.com/plfe/', headers=headers, proxies=proxies).status_code == 200:
if requests.get('https://pgorelease.nianticlabs.com/plfe/', headers=headers, proxies=proxies, timeout=15).status_code == 200:
headers = {'user-agent': 'pokemongo/1 CFNetwork/758.5.3 Darwin/15.6.0'}
if requests.get('https://sso.pokemon.com/', headers=headers, proxies=proxies).status_code == 200:
if requests.get('https://sso.pokemon.com/', headers=headers, proxies=proxies, timeout=15).status_code == 200:
return proxy
else:
Lprint ("Proxy is Banned")
Lprint ("Proxy {} is Banned or offline".format(proxy))
else:
Lprint ("Proxy is Banned")
Lprint ("Proxy {} is Banned or offline".format(proxy))

except Exception as e:
Lprint (e)
Expand Down Expand Up @@ -154,7 +154,26 @@ def MakeConf(CurThread, username, password):
stop()
except:
pass

if MultiBotConfig[u'TelegramTask']:
try:
for i in range(len(jsonData[u'tasks'])):
if jsonData[u'tasks'][1][u'type'] == u'TelegramTask':
jsonData[u'tasks'][i][u'config'][u'enabled'] = True
except KeyboardInterrupt:
stop()
except:
pass

if not MultiBotConfig[u'TelegramTask']:
try:
for i in range(len(jsonData[u'tasks'])):
if jsonData[u'tasks'][1][u'type'] == u'TelegramTask':
jsonData[u'tasks'][i][u'config'][u'enabled'] = False
except KeyboardInterrupt:
stop()
except:
pass

with open('configs/temp/config-' + str(CurThread) + '.json', 'w') as s:
s.write(json.dumps(jsonData))
s.close()
Expand Down

0 comments on commit e9f22d7

Please sign in to comment.