a b/doc/upmpdcli-cloud.txt
1
= Upmpdcli and the Cloud
2
3
== Introduction
4
5
upmpdcli is initially a UPnP Media Renderer device: it receives music
6
descriptors, and downloads and plays what it is requested to play (or more
7
precisely, tells MPD to play it).
8
9
As standard with UPnP, this is done in conjunction with a Control Point,
10
with which the user interacts, and a Media Server, which stores the music
11
and exports catalog and audio data. The Control Point browses the music
12
catalog offered by the Media Server, and tells upmpdcli/mpd what to play.
13
The Renderer then talks directly to the Media Server to download the audio
14
data.
15
16
This approach presents a difficulty for integrating a streaming service
17
such as Tidal, Qobuz, or Google Play Music: they require authentication,
18
and only provide temporary URLs for downloading (these URLs can't sit in a
19
playlist in the Renderer, they would expire). Using a "natural" approach
20
where the Control Point would browse the service, and the Renderer access
21
its data, there would be two devices which would need to know about the
22
details of the streaming service authentication and security: the Control
23
Point and the Renderer, probably needing, in addition, more communication
24
between the two than was standardized by UPnP.
25
26
There is a relatively simple solution to this problem, which is to design a
27
Media Server to act as a gateway to the services. The Media Server deals
28
with authentication, presents the service assets inside a browsable and
29
possibly searchable tree, and exports stable URLs to the local network
30
Renderers. When the data is actually requested, the Media Server manages to
31
provide it, which can be handled by an HTTP redirection to the freshly
32
translated service URL, or by actually proxying the data stream.
33
34
There are some potential reasons to closely associate such a Media Server
35
to a Control Point (a solution adopted by a very well known Android Control
36
Point), or to the Renderer itself, which is the approach chosen for
37
upmpdcli. In practise though, it was found that a standalone Media Server
38
works. The upmpdcli Media Server can provide access to any local Media
39
Renderer (upmpdcli-based or not), not only to its upmpdcli instance.
40
41
The current implementation supports Google Music, Qobuz and Tidal, and
42
would be easy to extend for other cloud services.
43
44
This only works for users who have a valid subscription for the service
45
they want to access.
46
47
The Media Server uses the services' WEB APIs which are in general not
48
officially supported, so that any service could stop working at any moment
49
if the supplier decides that they want to close access.
50
51
== Implementation
52
53
The Media Server was initially implemented as an embedded UPnP device
54
inside the Renderer device. This was found to confuse many Control Points,
55
so that the default approach is now to have the Media Server as a separate
56
root device (running inside a separate process because of libupnp
57
limitations).
58
59
The Media Server device will be created if the configuration file has set
60
parameters for any of the supported services. See the
61
link:upmpdcli.html#upmpdcli.configfile[configuration documentation] for
62
details (look for your service name).
63
64
== Installation and service-specific notes
65
66
The code for accessing most services is self-contained. There is an
67
exception for Google Music, which needs the separate installation of a
68
Python library.
69
70
=== Google Music
71
72
You need to install the
73
link:http://unofficial-google-music-api.readthedocs.io/en/latest/usage.html#usage[gmusicapi Python Package]
74
75
=== Tidal
76
77
Nothing for now.
78
79
=== Qobuz
80
81
Nothing for now.
82
83
84
85
86
87