Skip to main content

A Python module to view Telegram channel information

Project description

telegram-channel-viewer

A Python library that lets you view Telegram channels, users, and groups ( ONLY BASIC INFORMATION!! ) without needing a Telegram account or API credentials.

How It Works

The telegram-channel-viewer module parses public Telegram web pages to extract information:

  1. Channel Information:

    • Fetches data from https://t.me/{channel_name}
    • Extracts metadata from OpenGraph tags
    • Parses subscriber count and channel details
  2. Channel Messages:

    • Accesses https://t.me/s/{channel_name}
    • Retrieves message content, dates, and view counts
    • Extracts images and media from posts
  3. Specific Posts:

    • Retrieves post data from https://t.me/{channel_name}/{post_id}?embed=1&mode=tme
    • Provides clean, formatted content
    • Extracts post media and metadata

Installation

pip install git+https://github.com/bargmy/telegram-channel-viewer.git

Examples

Basic Channel Information

from telegram_channel_viewer import channel

Initialize channel viewer

ch = channel("durov")

Get basic channel info

print(f"Channel Name: {ch.channel_name}") print(f"Description: {ch.channel_description}") print(f"Subscribers: {ch.channel_subs}") print(f"Profile Picture: {ch.channel_profile}")

Get Channel Messages

Get all messages

messages = ch.messages print(messages) # Returns JSON with message content and URLs

Get all images

images = ch.images print(images) # Returns JSON with image URLs

Get Specific Post

post = ch.post("1234")

print(f"Content: {post.content}") print(f"Posted on: {post.date}") print(f"Views: {post.views}") print(f"Images: {post.images}")

Features

  • No Telegram API key required
  • Works with public channels, groups, and users
  • Extracts text content, images, and videos
  • JSON output format
  • Simple and lightweight

Dependencies

  • requests
  • beautifulsoup4

License

MIT License

Credits

Developed by Claude 3.5

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

telegram_channel_viewer-0.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

telegram_channel_viewer-0.1.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file telegram_channel_viewer-0.1.2.tar.gz.

File metadata

  • Download URL: telegram_channel_viewer-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for telegram_channel_viewer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9f68cc1572370588de4904d82d23dce28bf000f06bfb15d268925c76accba893
MD5 65144ab12b8c8663632644cb7a3bb4b1
BLAKE2b-256 65b71513333e937762baf1cf91138d9692b1470d54b2503f579721962cde67ce

See more details on using hashes here.

File details

Details for the file telegram_channel_viewer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_channel_viewer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ec67241affe6c22e9081de9c58f28f4841cf03abfe6b0410c91ebe1cf0736c3
MD5 93ce62224a55f7983f29c14d7162e777
BLAKE2b-256 1334aa90668a28895856e308ad95d6df01b179110c3aa8f29684f7b498da5fb5

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