about summary refs log tree commit diff
path: root/users/Profpatsch/whatcd-resolver/notes.org
blob: 24662c0f32a4c04c179c7c7950883c722ce3eedc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
* The Glorious what.cd¹ Resolver

  ¹: At the time of writing, what.cd didn’t 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 it’s 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.