Comments (4)
What I've doing so far is that when 2FA code is present what I do is print on the terminal with emojis the code needed to verify and add a delay to wait for me to approve the code. It's a hackish workaround and not very independent but works for me since I have in another screen and when I see the red alert on the terminal it gets my attention.
I'm sharing the code in case you want to try.
On line 392 I added this:
try:
twofactorvalue = driver.find_element(By.XPATH, value='//*[@id="idRemoteNGC_DisplaySign"]')
if twofactorvalue is not None:
print(f'π¨π¨π¨π¨{bcolors.FAIL}Using 2FA waiting for approval of code {twofactorvalue.text}{bcolors.ENDC}')
sleep(30)
print(f'Assumming you did aprove code')
return True
else:
password_field = driver.find_element(By.XPATH, value='//*[@id="i0118"]')
WebDriverWait(driver, 10).until(
EC.element_to_be_clickable(password_field)
)
password_field.send_keys(PASSWORD)
password_field.send_keys(Keys.ENTER)
except:
print(f'Unable to find password field for account {EMAIL}')
return False
and on line 220 I added this class I got from StackOverflow :
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
I could also add a local notification pop up or send Apprise alert with the code.
Just wanted two share my 2 cents
PS: If you are interested on the approach of sending a local notification on MacOS let me know.
from bingrewards.
I don't think that would be possible when using headless, Non-headless mode, you can quickly put in your 2FA credentials to do it .
from bingrewards.
Thank you @joeg1307 this is a good workaround. I will try it!
This however has no impact on other accounts if the 2FA is not active, correct?
from bingrewards.
@piersandro That's correct. And if you miss the approval of the code it will continue as normal. It will run the searches without being registered to your account, but at least it doesn't stop the whole thing and you can come back an try again. What I've been doing is, on the .env on the LOGIN
environment variable, at the very beginning of the string I set the account with 2FA so that's the first account to be handled.
In other words you can work also with the order of accounts set in the LOGIN
environment variable to better fit to your timing needs of approving the 2FA Codes.
from bingrewards.
Related Issues (20)
- Task automation problem
- Issue: Proxy Server does not connect (Mullvad) || Question: Multiple instances with multiple proxy support
- Request: SOCKS5 Proxy support HOT 1
- [FEATURE REQUEST] Account specific proxy HOT 1
- Mobile Searches unable to find element HOT 1
- Unable to start prebuilt docker image
- Use a maximum of 5 accounts per ip
- [FEATURE REQUEST] CAD in currency
- Last option in Quizzes HOT 12
- [Help] practical tutorial HOT 3
- Search not working in docker HOT 3
- The final mobile search does not count somehow HOT 4
- Unable to log in when this email is used with more than one account from Microsoft
- Error running docker image from README HOT 2
- Mobile Searches not working in India HOT 1
- Proxy support authentication with user and password HOT 1
- Friendly Notice: All my accounts were suspended HOT 2
- help!! HOT 1
- Request for Session Feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bingrewards.