{"id":29960269,"url":"https://github.com/chrisross5/telegram-scraper","last_synced_at":"2026-02-11T00:03:21.799Z","repository":{"id":302882871,"uuid":"1011638872","full_name":"ChrisRoss5/telegram-scraper","owner":"ChrisRoss5","description":"A creative Python/Vue project for scraping and viewing Telegram data, for the purpose of vibe coding to the max. ","archived":false,"fork":false,"pushed_at":"2025-09-10T16:55:05.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T20:44:24.655Z","etag":null,"topics":["python","telegram","telethon","vite","vue"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChrisRoss5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-01T06:05:10.000Z","updated_at":"2025-09-10T16:55:08.000Z","dependencies_parsed_at":"2025-08-04T01:10:57.866Z","dependency_job_id":"ea52cf19-46f2-46aa-94ee-6b95f9e859de","html_url":"https://github.com/ChrisRoss5/telegram-scraper","commit_stats":null,"previous_names":["chrisross5/telegram-scraper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChrisRoss5/telegram-scraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRoss5%2Ftelegram-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRoss5%2Ftelegram-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRoss5%2Ftelegram-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRoss5%2Ftelegram-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChrisRoss5","download_url":"https://codeload.github.com/ChrisRoss5/telegram-scraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRoss5%2Ftelegram-scraper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29322733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","telegram","telethon","vite","vue"],"created_at":"2025-08-03T22:09:05.330Z","updated_at":"2026-02-11T00:03:21.734Z","avatar_url":"https://github.com/ChrisRoss5.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Telegram Scraper\n\nA Python script to scrape messages, media, and comments from a specific Telegram channel using the Telethon library.\n\n## Features\n\n- Downloads all messages from a Telegram channel\n- Saves message metadata (sender info, reactions, views, forwards)\n- Downloads media files (videos, audio, images)\n- Scrapes comments/replies to messages\n- Handles forwarded messages and polls\n- Saves data to JSON format\n\n## Setup\n\n1. Install dependencies:\n\n   ```\n   pip install -r requirements.txt\n   ```\n\n2. Configure your Telegram API credentials in `config.json`:\n\n   - Copy and modify the config file with your credentials\n   - `api_id`: Your Telegram API ID\n   - `api_hash`: Your Telegram API hash\n   - `channel_username`: Target channel username\n\n3. Run the scraper:\n   ```\n   python index.py\n   ```\n\n## Command Line Options\n\nThe Telegram Scraper supports command-line flags to run without interactive prompts.\n\n### Basic Usage\n\n```bash\n# Run with default settings (real-time mode)\npython index.py\n\n# Run in historical sync mode without prompts\npython index.py --mode historical --no-prompts\n\n# Run in real-time mode without prompts\npython index.py --mode realtime --no-prompts\n```\n\n### Historical Sync Mode Options\n\n```bash\n# Historical sync with specific offset ID\npython index.py --mode historical --offset-id 12345 --no-prompts\n\n# Historical sync starting 100 messages before the latest (negative offset)\npython index.py --mode historical --offset-id -100 --no-prompts\n\n# Historical sync with stop count limit\npython index.py --mode historical --stop-count 100 --no-prompts\n\n# Historical sync with both offset and limit\npython index.py --mode historical --offset-id 12345 --stop-count 100 --no-prompts\n\n# Historical sync starting 50 messages back and processing 25 messages\npython index.py --mode historical --offset-id -50 --stop-count 25 --no-prompts\n```\n\n#### Understanding Negative Offset IDs\n\nWhen using negative offset IDs, the scraper calculates the actual starting point relative to the latest known message:\n\n- If your latest message ID is 10000 and you use `--offset-id -100`, the scraper will start from message ID 9900\n- This is useful for re-processing recent messages or catching up on messages you might have missed\n\n### Command Line Arguments\n\n- `--mode, -m`: Operating mode\n\n  - `1` or `historical`: Historical Sync mode\n  - `2` or `realtime`: Real-time Listening mode (default)\n\n- `--offset-id, -o`: Starting message ID for historical sync (default: calculated from last message)\n\n  - Positive values: Start from the specified message ID\n  - Negative values: Start from (default_offset_id + negative_value), e.g., -100 starts 100 messages before the default offset\n\n- `--stop-count, -s`: Maximum number of messages to process in historical sync (default: no limit)\n\n- `--no-prompts, -n`: Run without interactive prompts (use defaults or provided flags)\n\n### Usage Examples\n\n```bash\n# Interactive mode (original behavior)\npython index.py\n\n# Non-interactive real-time mode\npython index.py -n\n\n# Non-interactive historical sync from message ID 5000, process 50 messages\npython index.py -m historical -o 5000 -s 50 -n\n\n# Non-interactive historical sync starting 200 messages before latest\npython index.py -m historical -o -200 -n\n\n# Non-interactive historical sync with defaults\npython index.py -m 1 -n\n\n# Get help\npython index.py --help\n```\n\n## Output\n\n- `messages.json`: Contains all scraped message data\n- `media/`: Downloaded media files from posts\n- `media_in_comments/`: Downloaded media files from comments\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisross5%2Ftelegram-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisross5%2Ftelegram-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisross5%2Ftelegram-scraper/lists"}