Skip to content

Repository files navigation

TypeType

TypeType Downloader

The native download and muxing service for TypeType.

TypeType-Downloader receives jobs from TypeType-Server, downloads the selected media streams, muxes audio and video without re-encoding, and publishes the finished artifact through local or S3-compatible storage.

Extraction stays in TypeType-Server. If you want to install or update a complete instance, use the central TypeType stack.

Responsibilities

  • Persistent asynchronous download jobs
  • Concurrent HTTP Range downloads and progress aggregation
  • TypeType SABR segment downloads
  • Audio and video stream-copy muxing through libavformat
  • SSE job updates with polling-compatible state
  • Cancellation, cleanup, and storage-capacity safeguards
  • Local filesystem and S3/Garage artifact storage

Job API

MethodPathPurpose
GET/healthBasic service health
GET/health/deepDependency and storage health
POST/jobsCreate a download job
GET/jobs/{id}Read job state and progress
GET/jobs/{id}/eventsStream job updates through SSE
GET/jobs/{id}/artifactServe or redirect to the artifact
POST/jobs/{id}/cancelCancel a queued or running job
DELETE/jobs/{id}Delete a non-running job and its artifact

Jobs use queued, running, done, and failed as their stable lifecycle states. TypeType-Server exposes the authenticated user-facing gateway for this API.

Stack

RoleTechnology
LanguageGo 1.26
HTTP APIGo standard library
Muxinglibavformat through cgo
PersistencePostgreSQL
CacheDragonfly through the Redis protocol
StorageLocal filesystem or S3-compatible Garage

Development

Requirements:

  • Go 1.26
  • A C toolchain
  • libavformat, libavcodec, and libavutil development libraries
  • Docker Engine and Docker Compose v2 for the local service stack
gofmt -w cmd internal
go test ./...
go build ./...

Run the local Compose stack with development credentials:

DB_PASSWORD=change-me \
S3_ACCESS_KEY=change-me \
S3_SECRET_KEY=change-me \
docker compose up -d --build

Project structure

PathResponsibility
cmdService entry points
internal/api and internal/serverHTTP routes and server lifecycle
internal/downloader and internal/sabrDirect and SABR media transfer
internal/selector and internal/pipelineStream selection and job execution
internal/mux and internal/ffmpeglibavformat integration
internal/storage and internal/artifactArtifact persistence and delivery
internal/db, internal/job, and migrationsJob persistence

Read CONTRIBUTING.md before opening a pull request. Bug reports and feature requests belong in the central issue tracker.

License

TypeType-Downloader is licensed under GPL-3.0-or-later. Runtime notices are listed in THIRD_PARTY_NOTICES.md.

About

Native Go download backend for TypeType

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages