5 Commits

Author SHA1 Message Date
msramalho
3c9cb2ab99 click.prompt to input for notebooks compatibility 2024-01-25 17:35:48 +00:00
msramalho
dd6108a449 fix urls 2024-01-25 17:09:14 +00:00
msramalho
a649ce5ab6 pypi urls 2024-01-25 17:08:51 +00:00
msramalho
2b7dea31fd minor documentation improvements 2024-01-25 17:07:25 +00:00
msramalho
2a873a3733 fix badge 2024-01-25 17:02:08 +00:00
3 changed files with 12 additions and 7 deletions

View File

@@ -1,10 +1,11 @@
# telegram-phone-number-checker
Python tool/script toc heck if phone numbers are connected to Telegram accounts.
Python tool/script to check if phone numbers are connected to Telegram accounts. Retrieving username, name, and IDs where available.
## Installation
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/telegram-phone-number-checker)](https://pypi.org/project/telegram-phone-number-checker/)
[![PyPI - Version](https://img.shields.io/pypi/v/telegram-phone-number-checker)
](https://pypi.org/project/telegram-phone-number-checker/)
You can install this tool directly from the [official pypi release](https://pypi.org/project/telegram-phone-number-checker/).

View File

@@ -1,10 +1,14 @@
[tool.poetry]
name = "telegram-phone-number-checker"
version = "1.0.0"
version = "1.0.2"
description = "Check if phone numbers are connected to Telegram accounts."
authors = ["Bellingcat"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/bellingcat/telegram-phone-number-checker"
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/bellingcat/telegram-phone-number-checker/issues"
[tool.poetry.scripts]
telegram-phone-number-checker = "telegram_phone_number_checker.main:main_entrypoint"

View File

@@ -46,7 +46,7 @@ def validate_users(client, phone_numbers):
The function uses the get_api_response function to first check if the user exists and if it does, then it returns the first user name and the last user name.
'''
if not phone_numbers or not len(phone_numbers):
phone_numbers = click.prompt('Enter the phone numbers to check, separated by commas')
phone_numbers = input('Enter the phone numbers to check, separated by commas: ')
result = {}
phones = [p.strip() for p in phone_numbers.split(",")]
try:
@@ -62,9 +62,9 @@ def validate_users(client, phone_numbers):
def login(api_id, api_hash, phone_number):
"""Create a telethon session or reuse existing one"""
print('Logging in...', end="", flush=True)
API_ID = api_id or os.getenv('API_ID') or click.prompt('Enter your API ID')
API_HASH = api_hash or os.getenv('API_HASH') or click.prompt('Enter your API HASH')
PHONE_NUMBER = phone_number or os.getenv('PHONE_NUMBER') or click.prompt('Enter your phone number')
API_ID = api_id or os.getenv('API_ID') or input('Enter your API ID: ')
API_HASH = api_hash or os.getenv('API_HASH') or input('Enter your API HASH: ')
PHONE_NUMBER = phone_number or os.getenv('PHONE_NUMBER') or input('Enter your phone number: ')
client = TelegramClient(PHONE_NUMBER, API_ID, API_HASH)
client.connect()
if not client.is_user_authorized():