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:

Close any instance of https://messages.google.com and fire up a terminal / command prompt and run:

cpotp

On the first run, scan the QR code using your Messages app on the phone and pair it.

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.6.tar.gz (4.4 kB view details)

Uploaded Source

Built Distributions

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

cpotp-0.0.6-py3.8.egg (7.7 kB view details)

Uploaded Egg

cpotp-0.0.6-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cpotp-0.0.6.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for cpotp-0.0.6.tar.gz
Algorithm Hash digest
SHA256 b3e240f1d87ede09af952051f4ca55ab8ef2bfe78828e11cc09858cf00c190a6
MD5 3a7d69aecc215457f5f751c6f500a05e
BLAKE2b-256 dd6167deb1e6b516333b8273466c1c7a83911200e61710dac95ca12afdcd93d6

See more details on using hashes here.

File details

Details for the file cpotp-0.0.6-py3.8.egg.

File metadata

  • Download URL: cpotp-0.0.6-py3.8.egg
  • Upload date:
  • Size: 7.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for cpotp-0.0.6-py3.8.egg
Algorithm Hash digest
SHA256 bf29023f51cb51952f9390a313085833a4ae84d9c54ca52a7be09e29170ca8fc
MD5 5180561b654a5defe0f1984f12a8ce10
BLAKE2b-256 f3502cbcb73c850db79779246aae9773abcc75629a72161ff234a2d02490fb04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cpotp-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for cpotp-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 466811ef2208dd8e65e04c95f3bb9f8bbe07a9e83db0555340f5a07e0697f1cb
MD5 e03680ca7bf0ed093b5836875ba1a139
BLAKE2b-256 84c6d3e9bdda08e380f48c54875d8828e8663b597799b3f0ebcb31add13a7e4f

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