# getit

> File-host downloader with a terminal UI, a scripting CLI and an MCP server so AI agents can drive it.

- Role: Author
- Status: Packaged for PyPI and Homebrew; used personally
- Stack: Python, asyncio, Textual, SQLite, MCP
- Author: Ahmed Eltigani

## The problem

Each file host has its own flow: guest tokens and rate limits, wait times, captchas, passwords, client-side encryption. getit puts seven hosts behind one command, a terminal UI and an MCP server, so a person or an AI agent can run the queue.

## The build

One command downloads from GoFile, PixelDrain, MediaFire, 1Fichier, UploadFlix, Mega.nz and Anonfile.de, with a dashboard-style TUI for queue management.

## Result

Published on PyPI as getit-cli with a Homebrew tap. A personal-use tool; no adoption claims.

## What it does

- Concurrent downloads with smart resume, speed limits and recursive folder support.
- Client-side Mega.nz AES-CTR decryption; MD5/SHA256 integrity checks.
- Built-in MCP server: agents can list remote folders, start, poll and cancel downloads.
- Async engine, SQLite-backed task registry and an event bus for progress streaming.

## Engineering decisions

- Put one DownloadService facade behind the CLI, the TUI and the MCP server, so all three get identical behaviour.
- Make hosts self-registering extractors: adding one is a single file and a decorator, and the registry routes URLs to it.
- Publish progress through an event bus (progress, complete, error), so progress bars and MCP resource updates share one source instead of being wired to one UI.
- Limit concurrency with a semaphore in the manager, and keep resumable streaming, decryption and checksum validation in the downloader.
- Persist tasks in SQLite so MCP tools can poll status and cancel; the changelog notes WAL mode with a busy timeout.
- Read tokens from environment variables rather than config files; the changelog lists restrictive 600 permissions on config and history files and secret redaction in structured logs.

## How it's secured and shipped

- Credentials and tokens are read from environment variables rather than config files.
- Integrity verification of downloaded files; password-protected link handling.
- CI plus automated PR review configured on the repository.

## Next

- A download-history view; the SQLite task registry was built to support it.

Case study: https://www.ahmedeltigani.com/work/getit
