Metadata-Version: 2.2
Name: telegram_channel_viewer
Version: 0.1.2
Summary: A Python module to view Telegram channel information
Home-page: https://pypi.org/project/telegram-channel-viewer
Author: bargmy
Author-email: support@bargmy.ir
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: beautifulsoup4
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: summary

# 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 
