Skip to content

Commit

Permalink
mts2 get mts balance over puppeteer/pyppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
artyl committed Aug 12, 2020
1 parent d3ed49d commit 1a61598
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions plugin/httpserver_mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ def send_balance(self):
if self.updater is None:
return
baltxt = self.prepare_balance('LASTCHANGE')
if baltxt=='':
baltxt = 'No changes'
self.send_message(text=baltxt, parse_mode=telegram.ParseMode.HTML)

def stop(self):
Expand Down
9 changes: 8 additions & 1 deletion plugin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@
# Обновлять SQLite базу данными из MDB и на сколько дней в глубино
updatefrommdb = 0
updatefrommdbdeep = 30
chrome_executable_path = 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
# сюда пропишем сразу возможные варианты
chrome_executable_path_alternate = [
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',]

# Раздел [Telegram]
# Раздел mbplugin.ini [Telegram]
# формат для строки telegram bot из sqlite
tg_format = '<b>{Alias}</b>\t<code>{PhoneNumberFormat2}</code>\t<b>{Balance}</b>({BalDeltaQuery})'
tg_from = 'sqlite' # mobilebalance или sqlite
Expand All @@ -54,3 +59,5 @@
# 1 - показывать использованный трафик (usedByMe) по всем или 0 - показывать оставшийся трафик (NonUsed) по всем
# список тел, через запятую - показать использованный только для этого списка телефонов
mts_usedbyme = '0'


5 changes: 5 additions & 0 deletions plugin/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def drop_and_create_session(storename, headers=None):
session.headers.update(headers)
return session # return new session

def session_folder(storename):
options = read_ini()['Options']
storefolder = options.get('storefolder', settings.storefolder)
os.path.join(storefolder, storename)

class Session():
'Класс для сессии с дополнительными фишками для сохранения и проверки'
def __init__(self, storename, headers=None):
Expand Down
2 changes: 1 addition & 1 deletion python/get_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if not exist Scripts\pip.exe python get-pip.py
..\python\python -c "txt='''import os,sys\nsys.path.insert(0,os.path.split(sys.argv[0])[0])''';open('sitecustomize.py','w').write(txt)"

@REM Íàõîäÿñü mbplugin\python âûïîëíèòü
..\python\python -m pip install --upgrade python-telegram-bot requests pillow beautifulsoup4 pyodbc pyreadline pywin32 selenium pyppeteer
..\python\python -m pip install --upgrade python-telegram-bot requests pillow beautifulsoup4 pyodbc pyreadline pywin32 pyppeteer

@REM Ê ñîæàëåíèþ íå íàøåë âìåíÿåìîé èíñòðóêöèè ïî óñòàíîâêå tkinter òîëüêî ïåðåëîæèòü èç óñòàíîâëåííîãî python
@rem https://stackoverflow.com/questions/37710205/python-embeddable-zip-install-tkinter
Expand Down

0 comments on commit 1a61598

Please sign in to comment.