Read OTP automatically for every 5 secs from the Notification that pops up for each SMS mirrored to PC via Pushbullet
- Install Pushbullet on both Mobile Device(Android or iOS any) and Chrome Extension for PC.
- Configure your account and Enable "SMS Sync" option in the Mobile App.
Once you setup the pre-requisites, you should be able to see the SMS notifications on your PC.
numpy | Can be installed using "pip install numpy" |
clipboard | Can be installed using "pip install pyperclip" |
cv2 | Can be installed using "pip install opencv-python" |
ImageGrab | Can be installed using "pip install Pillow" |
pytesseract | Can be installed using "pip install pytesseract" Along with this, we need to dowload the tesseract executable file from the below link https://github.com/UB-Mannheim/tesseract/wiki |
- It grabs the Image of the Notification (both from Pop-up and the content from the Notification Tray which appears on the right side of the Desktop) using the module ImageGrab.
- Reads the text from the Image using the module pytesseract through OCR.
- Searches for the messages/notifications only the ones relevant for OTP based on the keywords 'OTP' or 'Verification' or 'Code'.
- And if any of the keywords match, then it reads the 6-digit or 4-digit number from that message.
- Once it reads the OTP, it would print it on the log and copy it to the clipboard automatically.
- Generate an SMS relevant for OTP so that we get a notification on the PC (can be as a pop-up or in the Notification Tray).
- Wait for 5 secs and just let the program take care of reading the OTP.
- As it is automatically copied to the clipboard, you can just paste it where you need to fill it.
Note: Please note that we will have open the Notification Tray for the program to capture the image in order to read the OTP