{"id":24986988,"url":"https://github.com/hitthecodelabs/telegrammediadownloader","last_synced_at":"2026-04-27T12:02:35.705Z","repository":{"id":270678912,"uuid":"911127827","full_name":"hitthecodelabs/TelegramMediaDownloader","owner":"hitthecodelabs","description":"Two scripts that enable you to send URLs to a Telegram group and download media files (and their captions) to local storage.","archived":false,"fork":false,"pushed_at":"2025-01-02T10:07:23.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T10:47:27.513Z","etag":null,"topics":["bot","downloader","json","telegram","telegram-api","telethon"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hitthecodelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-01-02T10:00:45.000Z","updated_at":"2025-01-02T12:12:00.000Z","dependencies_parsed_at":"2025-01-02T11:18:37.447Z","dependency_job_id":"e7f4ec28-20fe-44d5-b302-8047d8fa7843","html_url":"https://github.com/hitthecodelabs/TelegramMediaDownloader","commit_stats":null,"previous_names":["hitthecodelabs/telegrammediadownloader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hitthecodelabs/TelegramMediaDownloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FTelegramMediaDownloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FTelegramMediaDownloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FTelegramMediaDownloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FTelegramMediaDownloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hitthecodelabs","download_url":"https://codeload.github.com/hitthecodelabs/TelegramMediaDownloader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FTelegramMediaDownloader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bot","downloader","json","telegram","telegram-api","telethon"],"created_at":"2025-02-04T11:35:12.262Z","updated_at":"2026-04-27T12:02:35.669Z","avatar_url":"https://github.com/hitthecodelabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram URL Sender \u0026 Media Downloader\n\nA collection of two scripts that enable you to:\n1. Send URLs from a JSON file to a Telegram group at a specified interval.\n2. Listen in a Telegram group for media sent by a specific bot user and automatically download those media files (and their captions) to local storage.\n\n## Table of Contents\n\n- [Requirements](#requirements)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [API Credentials](#api-credentials)\n- [Usage](#usage)\n  - [Sender Script](#sender-script)\n  - [Downloader Script](#downloader-script)\n- [Project Structure](#project-structure)\n- [Security Disclaimer](#security-disclaimer)\n- [License](#license)\n\n---\n\n## Requirements\n\n- Python 3.7+  \n- [Telethon](https://github.com/LonamiWebs/Telethon)  \n\n---\n\n## Getting Started\n\n### Installation\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/hitthecodelabs/TelegramMediaDownloader.git\n   cd TelegramMediaDownloader\n   ```\n\n2. **Install dependencies (preferably inside a virtual environment)**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n   If you don’t already have `requirements.txt`, create one with:\n   ```text\n   telethon\n   ```\n\n   Or simply install Telethon directly:\n   ```bash\n   pip install telethon\n   ```\n\n---\n\n### API Credentials\n\nYou must have a Telegram API ID and API Hash.\n\n1. Sign in at [my.telegram.org](https://my.telegram.org).\n2. Go to **API development tools**.\n3. Copy the `api_id` and `api_hash` and place them in the scripts.\n\n---\n\n## Usage\n\n### Sender Script\n\n**File**: `telegram_sender.py`\n\nThis script reads from a JSON file containing URLs (e.g., `post_urls.json`) and sends them one by one to a specified Telegram group with a configurable delay between each send.\n\n**Update the following variables in the script**:\n\n- `API_ID`\n- `API_HASH`\n- `GROUP_NAME`\n- `GROUP_ID`\n- `JSON_FILE_PATH`\n- `SEND_DELAY_SECONDS` (optional, default is 120 seconds)\n\n**Run the script**:\n```bash\npython telegram_sender.py\n```\n\nOn the first run, you’ll be prompted to enter your phone number and the code you receive from Telegram. A session file (e.g., `session_name_001.session`) will be created for subsequent runs.\n\n---\n\n### Downloader Script\n\n**File**: `telegram_downloader.py`\n\nThis script listens to a specified Telegram group for messages from a particular bot user. If the message contains media, it downloads the media and the accompanying caption (if any) to local storage.\n\n**Update the following variables in the script**:\n\n- `API_ID`\n- `API_HASH`\n- `GROUP_NAME`\n- `BOT_USERNAME`\n\n**Run the script**:\n```bash\npython telegram_downloader.py\n```\n\nAgain, you may be asked for your phone number and verification code the first time you run this script. You can stop listening at any time by pressing `Ctrl + C`.\n\n---\n\n## Project Structure\n\nBelow is an example structure for your repository:\n\n```\ntelegram-url-sender-media-downloader/\n├─ downloads/                 # Downloaded media files (auto-created by script)\n├─ post_urls.json             # Example JSON file with URLs\n├─ telegram_sender.py         # Script to send URLs to a Telegram group\n├─ telegram_downloader.py     # Script to download media from a Telegram group\n├─ requirements.txt           # Required Python packages (i.e., Telethon)\n└─ README.md                  # Project documentation\n```\n\n---\n\n## Security Disclaimer\n\n- Never share your `api_id` and `api_hash` publicly. Treat them as sensitive credentials.\n- Do not commit your session files (`.session`) to version control.\n- Ensure you comply with Telegram’s Terms of Service while using these scripts.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. Feel free to use, modify, and distribute this code as permitted by the license.\n\n---\n\nHappy Coding! If you find this useful, consider giving it a star on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitthecodelabs%2Ftelegrammediadownloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitthecodelabs%2Ftelegrammediadownloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitthecodelabs%2Ftelegrammediadownloader/lists"}