tvl-depot/users/Profpatsch/whatcd-resolver/notes.org
Profpatsch 07b976ccd8 feat(users/Profpatsch): init whatcd-resolver
Change-Id: Ieb377fb8caa60e716703153dfeca5173f9a6779d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8830
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2023-07-14 08:03:14 +00:00

1.7 KiB
Raw Blame History

The Glorious what.cd¹ Resolver

¹: At the time of writing, what.cd didnt even exist anymore

Idea

Stream your music (or media) from a private tracker transparently. “Spotify for torrents”

Technical

You need to have a seedbox, which runs a server program. The server manages queries, downloads torrents and requested files, and provides http streams to the downloaded files (while caching them for seeding).

Clients then use the API to search for music (e.g. query for artists or tracks) and get back the promise of a stream to the resolved file (a bit how resolvers in the Tomahawk Player work)

The Server

Resolving queries

resolve :: Query -> IO Identifiers

A query is a search input for content (could be an artist or a movie name or something)

There have to be multiple providers, depending on the site used (e.g. one for Gazelle trackers, one for Piratebay) and some intermediate structure (e.g. for going through Musicbrainz first).

Output is a unique identifier for a fetchable resource; this could be a link to a torrent combined with a file/directory in said torrent.

Fetching Identifiers

fetch :: Identifier -> IO (Promise Stream)

Takes an Identifier (which should provide all information on how to grab the media file and returns a stream to the media file once its ready.

For torrents, this probably consists of telling the torrent library/application to fetch a certain torrent and start downloading the required files in it. The torrent fetcher would also need to do seeding and space management, since one usually has to keep a ratio and hard drive space is not unlimited.