Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram Settings added #6170

Merged
merged 1 commit into from
Jul 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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