Skip to main content

Command line tool to copy the latest OTP received in the connected Android device to the clipboard.

Project description

cpotp

PyPI

Command line tool to copy the latest OTP received in the connected Android device to the clipboard.

Why?

Simply because I don't want to pickup my phone, open the SMS app, remember the OTP, and then enter it.

Now you might say, haven't you heard about https://messages.google.com? Well, that's what is being used in the package. Selenium Chrome driver automates this process.

Prerequisite

Installation

Install cpotp

cpotp can be installed using pip

pip install cpotp

or install it from the source

git clone https://github.com/riteshpanjwani/cpotp.git
cd cpotp
python setup.py install

Install xclip (Linux only)

If you are using any fairly recent Debian Linux-based OS:

sudo apt install xclip

else, you can install it directly from the source:

git clone https://github.com/astrand/xclip.git
./bootstrap
./configure
make
make install

Verify that it installed:

man xclip

Set an environment variable

Next, you need to set an environment variable called CHROME_USER_DATA_DIR, in Chrome/Edge/Chromium browser new tab

chrome://version

and set this environment variable to path given in "Profile Path" except the "/Default" part. For example:

export CHROME_USER_DATA_DIR=/home/<username>/.config/google-chrome

Selenium will create a Chrome user profile called "cpotp" in this directory.

Usage

Note: the following command downloads the following files on the first run:

On the first run, scan the QR code using your Messages app on the phone and pair it. Close any instance of https://messages.google.com and fire up a terminal / command prompt and run:

cpotp-setup

On subsequent runs, you just have to run:

cpotp

License

For license information, see LICENSE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpotp-0.0.8.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpotp-0.0.8-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file cpotp-0.0.8.tar.gz.

File metadata

  • Download URL: cpotp-0.0.8.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for cpotp-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e89fbaa5269100dae3ecd037d055a3e4c43bb87841204ad32d27df0705ed5645
MD5 27354555fa5653c671deda110c991b25
BLAKE2b-256 4d29dcf0e2538a236110ac650014021a25f4f85ead080e65c83dd8817da9cf47

See more details on using hashes here.

File details

Details for the file cpotp-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: cpotp-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for cpotp-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c742eec722d5b2ab6303dbe58c4fc8165545d78f55f7bf110148c0f949f59746
MD5 d5b60caeb2dbc18c620ace188eb4fe14
BLAKE2b-256 6f105d6fe7788ce6308c77116d029f8bab2c153e6ba793d9935239a26be99a05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page