Skip to main content

Library for scrap telegram chats

Project description

lib_telegram_scrap

lib_telegram_scrap это библиотека для сбора информации из чатов

Установка из PyPI

pip install lib_telegram_scrap

Использование репозитория GitHub

git clone https://github.com/YuranIgnatenko/lib_telegram_scrap.git
cd lib_telegram_scrap
pip install .

Пример использования

from lib_telegram_scrap.scrapper import Scrapper 

async def main():
	scraper = TelegramScraper(api_id=YOUR_API_ID, api_hash='YOUR_API_HASH')
	
	COUNT_LAST_MESSAGES = 50
	URL_CHANNEL = "https://t.me/channel_name"

	messages = await scraper.get_last_messages(URL_CHANNEL, COUNT_LAST_MESSAGES)
	
	# Process messages
	for message in messages:
		print(f"Message: {message.message}")
		print(f"Date: {message.date}")
		print("---")

	await scraper.close()

if __name__ == "__main__":
	asyncio.run(main())

If first using, then enter console

phone number: +7xxxxxxxxx
received code from telegram: xxxxx
*your 2-password

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

lib_telegram_scrap-1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

lib_telegram_scrap-1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file lib_telegram_scrap-1.0.tar.gz.

File metadata

  • Download URL: lib_telegram_scrap-1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for lib_telegram_scrap-1.0.tar.gz
Algorithm Hash digest
SHA256 bc0b531772b10a913c91022951610370af5153db5134e660d8fea366ee0bbc76
MD5 21e0132fbe9d4ec07a73e6117ef0e71f
BLAKE2b-256 de6cfee9c069688a602bdcecc9a95b9175c3066835e51cea857f461387a4ffb9

See more details on using hashes here.

File details

Details for the file lib_telegram_scrap-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lib_telegram_scrap-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42bcb6a4ef963939ed3ee9448d4ff7bb5bbcef49828761b9429a9deeb8fac1a2
MD5 7c0450565c5d2f087a9d030ed08b015c
BLAKE2b-256 9cb899af21ab8e00c5ffb9cc2c30c6e38a40b61c10757323fc74998fb4318e03

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