{"id":51221037,"url":"https://github.com/sankhya007/python-torrent-client","last_synced_at":"2026-06-28T07:03:29.402Z","repository":{"id":321092289,"uuid":"1084379005","full_name":"sankhya007/python-torrent-client","owner":"sankhya007","description":"Build your own BitTorrent client! This educational implementation covers: - Bencode serialization/deserialization - HTTP tracker protocol - Peer wire protocol (handshakes, choking, pieces) - Async I/O with asyncio - File management and piece verification  Perfect for learning networking protocols and P2P systems.","archived":false,"fork":false,"pushed_at":"2025-10-27T18:15:24.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-27T19:30:02.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sankhya007.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-10-27T15:48:18.000Z","updated_at":"2025-10-27T18:15:28.000Z","dependencies_parsed_at":"2025-10-27T19:30:05.299Z","dependency_job_id":null,"html_url":"https://github.com/sankhya007/python-torrent-client","commit_stats":null,"previous_names":["sankhya007/python-torrent-client"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sankhya007/python-torrent-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankhya007%2Fpython-torrent-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankhya007%2Fpython-torrent-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankhya007%2Fpython-torrent-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankhya007%2Fpython-torrent-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sankhya007","download_url":"https://codeload.github.com/sankhya007/python-torrent-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankhya007%2Fpython-torrent-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34880191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"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":[],"created_at":"2026-06-28T07:03:28.183Z","updated_at":"2026-06-28T07:03:29.393Z","avatar_url":"https://github.com/sankhya007.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧲 Python BitTorrent Client\n\nA complete BitTorrent client implementation in Python from scratch. \nFeatures torrent file parsing, tracker communication, peer-to-peer networking, \nand actual file downloading. Built for educational purposes to understand \nthe BitTorrent protocol and async networking in Python.\n\n## ✨ Features\n\n- ✅ Torrent File Parsing - Parse .torrent files and extract metadata\n- ✅ Tracker Communication - HTTP tracker support with peer discovery  \n- ✅ Peer Protocol - Full BitTorrent peer protocol implementation\n- ✅ Async Networking - High-performance async peer connections\n- ✅ Actual File Downloading - Real file assembly and writing\n- ✅ Progress Tracking - Live download progress and speed monitoring\n- ✅ Web Port Tunneling - Connect via ports 80/443/53 when restricted\n- ✅ Network Diagnostics - Comprehensive connectivity testing\n- ✅ Emergency Simulation - Demo mode when P2P connections are blocked\n\n## 🚀 Quick Start\n\n# Clone the repository\ngit clone https://github.com/sankhya007/python-torrent-client\ncd torrent-client-python\n\n# Install dependencies\npip install -r requirements.txt\n\n# Run the client\npython torrent_client.py\n\nEnter the path to a .torrent file when prompted.\n\n## 📋 Requirements\n\nPython 3.8+\n\nDependencies:\n\nbash\npip install bencodepy requests\n\n## 🔧 How It Works\n\n1. Torrent Parsing - Extracts metadata and file information from .torrent files\n2. Tracker Contact - Communicates with trackers to discover peers\n3. Peer Connection - Establishes P2P connections using BitTorrent protocol\n4. Piece Management - Downloads file pieces and verifies integrity\n5. File Assembly - Reconstructs complete file from downloaded pieces\n\n## 🌐 Network Features\n\n- Multi-port Support: Tries standard ports (6881-6889) and web ports (80, 443, 53)\n- Aggressive Retry: Multiple connection attempts with exponential backoff\n- Peer Prioritization: Intelligent peer selection for better connectivity\n- Firewall Bypass: Web port tunneling for restricted networks\n\n## ⚠️ Legal Notice\n\nOnly use with legal torrents:\n- Ubuntu/Linux ISOs\n- Open source software  \n- Creative Commons content\n- Your own files\n\nThis project is for educational purposes to understand P2P protocols and networking.\n\n## 🚧 Development Status\n\n🔄 Completed\n- Basic torrent parsing\n- Tracker communication\n- Peer connections\n- File downloading\n- Progress tracking\n- Web port tunneling\n\n📋 Planned Features\n- DHT support (trackerless torrents)\n- Web interface\n- Download scheduling  \n- Multiple torrent management\n- Magnet link support\n- UDP tracker support\n- Encryption protocol\n- Seed mode (uploading)\n\n## 🎯 Learning Goals\n\n- Understanding BitTorrent protocol specification\n- Async networking in Python with asyncio\n- Peer-to-peer architecture and protocols  \n- File I/O optimization and piece management\n- Network diagnostics and troubleshooting\n\n## 🤝 Contributing\n\nThis is an educational project. Feel free to:\n- Report bugs and issues\n- Suggest improvements\n- Submit pull requests\n- Fork for your own experiments\n\n## 📚 Resources\n\n- BitTorrent Protocol Specification\n- Python asyncio Documentation\n\n---\n\nDisclaimer: Use responsibly and only download content you have rights to.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsankhya007%2Fpython-torrent-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsankhya007%2Fpython-torrent-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsankhya007%2Fpython-torrent-client/lists"}