Skip to content

Commit

Permalink
fix mypy error
Browse files Browse the repository at this point in the history
src/extract_otp_secrets.py:707: error: Argument 1 to "save" of "PyPNGImage" has incompatible type "str"; expected "SupportsWrite[bytes]"  [arg-type]
  • Loading branch information
scito committed Feb 8, 2025
1 parent 38e7e8b commit 10a60ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,11 @@ FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependenc
* [Android OTP Extractor](https://github.com/puddly/android-otp-extractor) can extract your tokens from popular Android OTP apps and export them in a standard format or just display them as QR codes for easy importing. [Requires a _rooted_ Android phone.]
* [Google Authenticator secret extractor](https://github.com/krissrex/google-authenticator-exporter) is similar project written in JavaScript. It also extracts otp secrets from Google Authenticator.

## Third party documentation

* [TOTP Secret Extraction from QR codes (medium.com)](https://cavalloj.medium.com/totp-secret-extraction-from-qr-codes-ee097b4c687f)
* [Google Authenticator: OTP-Secrets auslesen (stadt-bremerhaven.de)](https://stadt-bremerhaven.de/google-authenticator-otp-secrets-auslesen/)

***

# #StandWithUkraine 🇺🇦
Expand Down
4 changes: 2 additions & 2 deletions src/extract_otp_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
TypedDict, Union)

import colorama
from qrcode import QRCode # type: ignore
from qrcode import QRCode

import protobuf_generated_python.google_auth_pb2 as pb

Expand Down Expand Up @@ -704,7 +704,7 @@ def save_qr_image_file(otp_url: OtpUrl, name: str) -> None:
qr.add_data(otp_url)
img = qr.make_image(fill_color='black', back_color='white')
if verbose: print(f"Saving to {name}")
img.save(name)
img.save(name) # type: ignore


def print_qr(otp_url: str, out: Optional[TextIO] = None) -> None:
Expand Down

0 comments on commit 10a60ab

Please sign in to comment.