Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Oct 4, 2023
2 parents 034cb32 + 2deca32 commit 7037d6f
Show file tree
Hide file tree
Showing 127 changed files with 4,835 additions and 1,006 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM lsiobase/alpine:3.17 as base
FROM lsiobase/alpine:3.18 as base

ENV TZ=Etc/GMT

Expand All @@ -24,7 +24,8 @@ ENV CONFIG_DIR=$data_dir

COPY docker/root/ /

RUN npm install -g patch-package
RUN npm install -g patch-package \
&& chown -R root:root /usr/local/lib/node_modules/patch-package

WORKDIR /app

Expand All @@ -39,7 +40,8 @@ COPY --chown=abc:abc package*.json tsconfig.json ./
COPY --chown=abc:abc patches ./patches


RUN npm install
RUN npm install \
&& chown -R root:root node_modules
#RUN yarn install

COPY --chown=abc:abc . /app
Expand Down Expand Up @@ -72,7 +74,7 @@ ENV IS_DOCKER=true

RUN npm install --omit=dev \
&& npm cache clean --force \
&& chown abc:abc node_modules \
&& chown -R abc:abc node_modules \
&& rm -rf node_modules/ts-node \
&& rm -rf node_modules/typescript \
&& rm -rf node_modules/@types
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
* Supports scrobbling from many **Sources**
* [Spotify](/docsite/docs/configuration/configuration.md#spotify)
* [Plex](/docsite/docs/configuration/configuration.md#plex) or [Tautulli](/docsite/docs/configuration/configuration.md#tautulli)
* [Subsonic-compatible APIs](/docsite/docs/configuration/configuration.md#subsonic) (like [Airsonic](https://airsonic.github.io/))
* [Subsonic-compatible APIs](/docsite/docs/configuration/configuration.md#subsonic) (like [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))
* [Jellyfin](/docsite/docs/configuration/configuration.md#jellyfin)
* [Youtube Music](/docsite/docs/configuration/configuration.md#youtube-music)
* [Last.fm](/docsite/docs/configuration/configuration.md#lastfm-source)
Expand Down Expand Up @@ -44,7 +44,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c

Yes! You can use [Last.fm as a **Source**](/docsite/docs/configuration/configuration.md#lastfm--source-) or [Listenbrainz as a **Source**](/docsite/docs/configuration/configuration.md#listenbrainz--source-) to forward scrobbles from your profile to any other Client! That way you can keep your current scrobble setup as-is but still get the benefit of capturing your data to a self-hosted location.

<img src="/assets/status-ui.jpg" width="800">
<img src="/assets/status-ui.png" width="800">

## How Does multi-scrobbler (MS) Work?

Expand Down
Binary file removed assets/status-ui.jpg
Binary file not shown.
Binary file added assets/status-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions config/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"sources": [
{
"type": "spotify",
"enable": true,
"clients": ["myConfig"],
"name": "mySpotifySource",
"data": {
Expand All @@ -33,6 +34,7 @@
"clients": [
{
"type": "maloja",
"enable": true,
"name": "myConfig",
"data": {
"url": "http://localhost:42010",
Expand Down
1 change: 1 addition & 0 deletions config/deezer.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "FoxxMDeezer",
"enable": true,
"clients": [],
"data": {
"clientId": "a89cba1569901a0671d5a9875fed4be1",
Expand Down
1 change: 1 addition & 0 deletions config/jellyfin.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyJellyfin",
"enable": true,
"clients": [],
"data": {
"users": ["FoxxMD"],
Expand Down
1 change: 1 addition & 0 deletions config/jriver.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyJriver",
"enable": true,
"data": {
"url": "0.0.0.0",
"username": "auser",
Expand Down
1 change: 1 addition & 0 deletions config/kodi.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyKodi",
"enable": true,
"data": {
"url": "http://localhost:8080/jsonrpc",
"username": "myUser",
Expand Down
1 change: 1 addition & 0 deletions config/lastfm.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "myLastFm",
"enable": true,
"configureAs": "client",
"data": {
"apiKey": "a89cba1569901a0671d5a9875fed4be1",
Expand Down
1 change: 1 addition & 0 deletions config/listenbrainz.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "brainz",
"enable": true,
"configureAs": "client",
"data": {
"token": "029b081ba-9156-4pe7-88e5-3be671f5ea2b",
Expand Down
1 change: 1 addition & 0 deletions config/maloja.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "myMaloja",
"enable": true,
"data": {
"url": "http://localhost:42010",
"apiKey": "myMalojaKey"
Expand Down
1 change: 1 addition & 0 deletions config/mopidy.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyMopidy",
"enable": true,
"data": {
"url": "localhost",
"uriBlacklist": [],
Expand Down
1 change: 1 addition & 0 deletions config/mpris.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "ubuntu",
"enable": true,
"data": {
"whitelist": ["vlc", "mpd"],
"blacklist": ["spotify"]
Expand Down
1 change: 1 addition & 0 deletions config/plex.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyPlex",
"enable": true,
"clients": [],
"data": {
"user": ["username@gmail.com","anotherUser@gmail.com"],
Expand Down
1 change: 1 addition & 0 deletions config/spotify.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MySpotify",
"enable": true,
"clients": [],
"data": {
"clientId": "a89cba1569901a0671d5a9875fed4be1",
Expand Down
1 change: 1 addition & 0 deletions config/subsonic.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MySubsonic",
"enable": true,
"data": {
"url": "http://localhost:4040/airsonic",
"user": "yourUser",
Expand Down
1 change: 1 addition & 0 deletions config/tautulli.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyTautuilli",
"enable": true,
"clients": [],
"data": {
"user": ["username@gmail.com","anotherUser@gmail.com"],
Expand Down
1 change: 1 addition & 0 deletions config/ytmusic.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"name": "MyYTMusic",
"enable": true,
"clients": [],
"data": {
"cookie": "VISITOR_INFO1_LIVE=jMDXz2_L8rY; __Secure-3PAPISID=3AxsXpSXGqOInSDn1jEKn; DEVICE_INFO=ChxOekU0TmTBpjek5EWZ0G; YSC=7gZdl3Zdl3; SID=TwhNsaZRXYTAtXxzGyu6rZdpg2HvGROeW8J4Ym_FhkhoZMUYEQ.; __Secure-1PSID=TwhNOsaZRXYTyRBe4rxAtXRIKsIEtk_Qot2VLBNfHQrQ.; __Secure-3PSID=ZRXYTAtXRIKsIEtk_Qot2yRBerZdpg2HvvZRXYTAtXRIKsIEtk_Qot2yRBerkuZICFQ.; HSID=A1UMmELW79; SSID=AKhomOs; APISID=IlHHmuzkPdQzZZDhHn3; SAPISID=3AxsXpy0u75Qb/n1jEKn; __Secure-1PAPISID=3AxsXpQb/AkSDn1jEKn; LOGIN_INFO=AFmP6vFpyVCZZAIgDwbkhWMBBhluaIWAPP:QUQ314UW5NWMjNmd2ZUJnYnJsakdIMjZoaE5zVVMjNmd2ZZUiHRlb3ZlV3ZIcUVyRVIMjNmdjNmd2ZZUivYlNqX2ZNZUiHdUNFNFdaYmJIW1NkJRX3hqdlU2YnFESkFuSS1uTldnZVRmLXNjWFc5OUJuR3dTd3JsZGZYa2EtZFQ2a0k2Ry1KQQ==; PREF=volume=26; SIDCC=AFvI_94PxXwls-ndqpGfPgFX3FWj80y_94PxXwls-ndqfSh15sP; __Secure-1PSIDCC=AFvIBnUbRr96I96UCIp2U4T8HRVk2B0HfKzhzxwsiP; __Secure-3PSIDCC=AFvIB3bINuUN0ETDR9gO91wpwWIVmpGki3BxT3bINuUN0ETDR9gO91wCH",
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ services:
#- MALOJA_API_KEY=
#- PUID=1000 # required if running docker on linux host, see main README Docker setup instructions
#- PGID=1000 # required if running docker on linux host, see main README Docker setup instructions

# set if using a source/client with redirect URI that you have not explicitly set and MS is NOT running on the same machine that you will view the dashboard from
# EX: You will view MS dashboard at 'http://192.168.0.101:9078' -> set BASE_URL=http://192.168.0.101:9078
#- BASE_URL=http://MyHostIP:9078
volumes:
- /path_on_host/multi-scrobbler-config:/config
#networks:
Expand Down
17 changes: 17 additions & 0 deletions docsite/docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
* [Connection Issues](#connection-issues)
* [Plex/Tautulli/Jellyfin don't connect](#plextautullijellyfin-dont-connect)
* [Jellyfin has warnings about undefined or missing data](#jellyfin-has-warnings-about-undefined-or-missing-data)
* [Jellyfin has warnings about missing headers](#jellyfin-has-warnings-about-missing-headers)
* [Spotify/Deezer/LastFM won't authenticate](#spotifydeezerlastfm-wont-authenticate)
* [Configuration Issues](#configuration-issues)
* [Config could not be parsed](#config-could-not-be-parsed)
Expand Down Expand Up @@ -95,6 +96,22 @@ You can verify the payload sent from the webhook by modifying your jellyfin conf

If your issue persists and you open an Issue for it please include the raw payload logs in your report.

## Jellyfin has warnings about missing headers

If you experience issues trying to scrobble with Jellyfin and find this in your MS logs

```
[API] Jellyfin is not sending a request with valid headers...
```

A workaround that may fix this:

* In Webhook settings:
* [In the webhook you have already configured...](configuration/configuration.md#jellyfin)
* Add Request Header...
* **Key:** `Content-Type`
* **Value:** `application/json`
* Then Save

## Spotify/Deezer/LastFM won't authenticate

Expand Down
19 changes: 18 additions & 1 deletion docsite/docs/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@ Example directory structure:

See the [/config](https://github.com/FoxxMD/multi-scrobbler/blob/master/config) directory of this project for examples of each type of config file or reference specific files below.

# Application Options

These options affect multi-scrobbler's behavior and are not specific to any source/client.

#### Base URL

Defines the URL that is used to generate default redirect URLs for authentication on [spotify](#spotify), [lastfm](#lastfm), and [deezer](#deezer) -- as well as some logging hints.

* Default => `http://localhost`
* Set with [ENV](#env-based-configuration) `BASE_URL` or `baseUrl` [all-in-one configuration](#all-in-one-file-configuration)

EX: Lastfm Redirect Url is `BASE_URL:PORT/lastfm/callback` -- Set `BASE_URL=http://192.168.0.101` => Redirect URL is `http://192.168.0.101:9078/lastfm/callback` (when no other redirectUri is specified for [lastfm configuration](#lastfm))

Useful when running with [docker](../installation/installation.md#docker) so that you do not need to specify redirect URLs for each configuration.

# Source Configurations

## [Spotify](https://www.spotify.com)
Expand Down Expand Up @@ -217,7 +232,7 @@ See [`tautulli.json.example`](https://github.com/FoxxMD/multi-scrobbler/blob/mas

## [Subsonic](http://www.subsonic.org/)

Can use this source for any application that implements the [Subsonic API](http://www.subsonic.org/pages/api.jsp) (such as [Airsonic](https://airsonic.github.io/))
Can use this source for any application that implements the [Subsonic API](http://www.subsonic.org/pages/api.jsp) and supports the [`getNowPlaying`](http://www.subsonic.org/pages/api.jsp#getNowPlaying) endpoint (such as [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))

**Known Issues:**
* "Time played at" is somewhat inaccurate since the api only reports "played X minutes ago" so...
Expand Down Expand Up @@ -255,6 +270,8 @@ Must be using Jellyfin 10.7 or greater
* Check `Send All Properties`
* Save

If you see errors in the MS logs regarding `missing headers` when using Jellyfin [see this workaround.](../FAQ.md#jellyfin-has-warnings-about-missing-headers)

### ENV-Based

| Environmental Variable | Required? | Default | Description |
Expand Down
18 changes: 17 additions & 1 deletion docsite/docs/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Recommended configuration steps for docker or docker-compose usage:

#### Storage

You **must** bind a host directory into the container for storing configurations and credentials. Otherwise these will be lost when the container is updated.
You **must** bind a host directory into the container for storing configurations and credentials. Otherwise, these will be lost when the container is updated.

* [Using `-v` method for docker](https://docs.docker.com/storage/bind-mounts/#start-a-container-with-a-bind-mount): `-v /path/on/host/config:/config`
* [Using docker-compose](https://docs.docker.com/compose/compose-file/compose-file-v3/#short-syntax-3): `- /path/on/host/config:/config`
Expand All @@ -98,6 +98,20 @@ The default container port is `9078`. To map container to host port:
* With [docker](https://docs.docker.com/engine/reference/commandline/run/#publish): `-p 9078:9078` (first port is the port on the host to use)
* With [docker-compose](https://docs.docker.com/compose/compose-file/compose-file-v3/#short-syntax-1): `- "9078:9078"`

##### Base URL

Optionally, when

* using a [Source or Client](../configuration/configuration.md) that has a "Redirect URI" that you have not explicitly defined
* and
* using a bridge network or
* installing MS on a different machine than the one used to view the dashboard

set the [Base URL](../configuration/configuration.md#base-url) as the IP of the host machine. (This is the IP you would use to view the dashboard in a browser)

* With docker: `-e BASE_URL="http://hostMachineIP"` (first port is the port on the host to use)
* With docker-compose: [see comments in docker-compose.yml](../../../docker-compose.yml)

#### Other

* (Optionally) set the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the container using the environmental variable `TZ` ([docker](https://docs.docker.com/engine/reference/commandline/run/#env)) ([docker-compose](https://docs.docker.com/compose/compose-file/compose-file-v3/#environment))
Expand All @@ -120,6 +134,8 @@ To get the UID and GID for the current user run these commands from a terminal:

## Docker Usage Examples

If installing on a different machine make sure all redirect URIs are defined or that you have set a [Base URL](#base-url).

### Using [env-based](../configuration/configuration.md#env-based-configuration) configuration

```bash
Expand Down
4 changes: 2 additions & 2 deletions docsite/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
* Supports scrobbling from many **Sources**
* [Spotify](docs/configuration#spotify)
* [Plex](docs/configuration#plex) or [Tautulli](docs/configuration#tautulli)
* [Subsonic-compatible APIs](docs/configuration#subsonic) (like [Airsonic](https://airsonic.github.io/))
* [Subsonic-compatible APIs](docs/configuration#subsonic) (like [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))
* [Jellyfin](docs/configuration#jellyfin)
* [Youtube Music](docs/configuration#youtube-music)
* [Last.fm](docs/configuration#lastfm-source)
Expand Down Expand Up @@ -47,7 +47,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c

Yes! You can use [Last.fm as a **Source**](docs/configuration#lastfm--source-) or [Listenbrainz as a **Source**](docs/configuration#listenbrainz--source-) to forward scrobbles from your profile to any other Client! That way you can keep your current scrobble setup as-is but still get the benefit of capturing your data to a self-hosted location.

<img src={require('/img/status-ui.jpg').default} width="800"/>
<img src={require('/img/status-ui.png').default} width="800"/>

## How Does multi-scrobbler (MS) Work?

Expand Down
1 change: 1 addition & 0 deletions docsite/static/configExample.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"maxRequestRetries": 1,
"retryMultiplier": 1.5
},
"baseUrl": "http://localhost",
"sources": [
{
"type": "spotify",
Expand Down
Binary file removed docsite/static/img/status-ui.jpg
Binary file not shown.
Binary file added docsite/static/img/status-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"ext": "js"
"ext": "js",
"ignore": ["tailwind.config.js"]
}
Loading

0 comments on commit 7037d6f

Please sign in to comment.