Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit b0d9f1e

Browse files
committed
added hide email
1 parent 96ea28b commit b0d9f1e

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ drivers/
1010
logs/
1111
geckodriver.log
1212

13-
# JetBrains
14-
.idea/
13+
# vscode
14+
.vscode/
1515

1616
# cached python objects
1717
*.pyc

helper/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def hide_email(email: str):
2+
email_parts = email.split('@')
3+
return f'{email_parts[0][:2]}{"*"*(len(email_parts[0])-3)}{email_parts[0][-1]}@{email_parts[1]}'

ms_rewards.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
import json
33
import logging
4+
from helper.utils import hide_email
45
from msreward.msr import MSR
56
import os
67
import platform
@@ -69,7 +70,8 @@ def parse_args():
6970
action='store_true',
7071
dest='exit_on_finish',
7172
default=False,
72-
help=f'Script will exit when finishes, otherwise will remain open and wait for user to press enter to end.')
73+
help='Script will exit when finishes, otherwise will remain open and wait for user to press enter to end.')
74+
7375
_parser = arg_parser.parse_args()
7476
if _parser.all_mode:
7577
_parser.mobile_mode = True
@@ -82,8 +84,7 @@ def get_login_info():
8284
with open('ms_rewards_login_dict.json', 'r') as f:
8385
return json.load(f)
8486

85-
86-
if __name__ == '__main__':
87+
def run_bot():
8788
check_python_version()
8889
if os.path.exists("drivers/chromedriver.exe"):
8990
update_driver()
@@ -101,15 +102,15 @@ def get_login_info():
101102
login_cred = get_login_info()
102103
logging.info(msg=f'logins retrieved, {len(login_cred)} account(s):')
103104
for cred in login_cred:
104-
logging.info(msg=f'{cred["email"]}')
105+
logging.info(msg=f'{hide_email(cred["email"])}')
105106

106107
msrs = [MSR(x['email'], x['password'], x['secret'] if 'secret' in x else None, parser.headless)
107108
for x in login_cred]
108109

109110
for msr in msrs:
110111
logging.info(
111112
msg='--------------------------------------------------')
112-
logging.info(msg=f'Current account: {msr.email}')
113+
logging.info(msg=f'Current account: {hide_email(msr.email)}')
113114
msr.work(flag_pc=parser.pc_mode, flag_mob=parser.mobile_mode,
114115
flag_quiz=parser.quiz_mode)
115116

@@ -121,3 +122,7 @@ def get_login_info():
121122
logging.info(msg='--------------------------------------------------')
122123
if not parser.exit_on_finish:
123124
input('Press any key to exit...')
125+
126+
127+
if __name__ == '__main__':
128+
run_bot()

msreward/account/login.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pyotp
77

88
from helper.browser import Browser
9+
from helper.utils import hide_email
910

1011
# URLs
1112
LOGIN_URL = 'https://login.live.com/'
@@ -27,7 +28,7 @@ class MSRLogin:
2728
otp_secret: str
2829

2930
def log_in(self):
30-
logging.info(msg=f'Logging in {self.email}...')
31+
logging.info(msg=f'Logging in {hide_email(self.email)}...')
3132
self._browser.get(LOGIN_URL)
3233
time.sleep(0.5)
3334

0 commit comments

Comments
 (0)