mirror of
https://github.com/FoxxMD/multi-scrobbler.git
synced 2026-09-03 05:10:00 +03:00
Compare commits
101
Commits
0.10.0-RC1
...
0.10.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86a719ba4a | ||
|
|
39b6f6e602 | ||
|
|
bfce5dcc54 | ||
|
|
18537e4e08 | ||
|
|
30db8712fc | ||
|
|
1701a5e5f1 | ||
|
|
406c39b6b2 | ||
|
|
ce7ad36db4 | ||
|
|
fa4bf5ab10 | ||
|
|
83d9af2aea | ||
|
|
433761525c | ||
|
|
f7a7a36d8b | ||
|
|
7e375f1531 | ||
|
|
357397f225 | ||
|
|
78bf507226 | ||
|
|
f892851b60 | ||
|
|
4244ddb8c2 | ||
|
|
3e67e9189f | ||
|
|
de1cbb2aae | ||
|
|
db17455b2e | ||
|
|
a7729fbfa6 | ||
|
|
771fdc0686 | ||
|
|
8cad2d4efd | ||
|
|
a094a1aa65 | ||
|
|
f2d45c5622 | ||
|
|
a429bccf07 | ||
|
|
04d950980d | ||
|
|
7ec90b97d6 | ||
|
|
a4f989c5e4 | ||
|
|
da4fbd2f27 | ||
|
|
b9e6f32500 | ||
|
|
5c5c653c3b | ||
|
|
a9e7a4bf16 | ||
|
|
1b4baafa67 | ||
|
|
794ef08aa2 | ||
|
|
fa6ed323ff | ||
|
|
8110e8e9fa | ||
|
|
12a6eec740 | ||
|
|
472021dd2c | ||
|
|
ebb74d1b5c | ||
|
|
ea23a89101 | ||
|
|
9062619d38 | ||
|
|
3fb64be54f | ||
|
|
3e083b19f7 | ||
|
|
e197c71bbb | ||
|
|
7b36d95dfc | ||
|
|
0427b6e945 | ||
|
|
326d9e58d7 | ||
|
|
63c079f08e | ||
|
|
ff74fd7e4c | ||
|
|
680f862ee8 | ||
|
|
abdd7f0b55 | ||
|
|
c017dd734b | ||
|
|
ad478adefd | ||
|
|
b11bd52963 | ||
|
|
538df6b6d0 | ||
|
|
819afcdb8a | ||
|
|
a5693f7c03 | ||
|
|
22eb5b1168 | ||
|
|
9402caa4ae | ||
|
|
0aff56e891 | ||
|
|
a5f6aaa7c0 | ||
|
|
4ee503655c | ||
|
|
e53a82782c | ||
|
|
020c6815ba | ||
|
|
5281a92e81 | ||
|
|
8577eb44af | ||
|
|
edd3cf25b5 | ||
|
|
b17719c868 | ||
|
|
971ec9d4db | ||
|
|
6607654e8a | ||
|
|
891e591ceb | ||
|
|
2540ed3945 | ||
|
|
7ac3f33cd4 | ||
|
|
9b91f6897e | ||
|
|
bc62b99401 | ||
|
|
a5d1cea910 | ||
|
|
3e3473f6a8 | ||
|
|
a0bdd15d15 | ||
|
|
920eb10c05 | ||
|
|
ae7a436758 | ||
|
|
92d246b45a | ||
|
|
0af480ac1a | ||
|
|
9f52c2ec67 | ||
|
|
cfb278087e | ||
|
|
402b0d2cc7 | ||
|
|
67c79f2eb7 | ||
|
|
d759b00c7e | ||
|
|
cac8163e58 | ||
|
|
11dbdaf6cc | ||
|
|
ac6b04f492 | ||
|
|
0790da2e0d | ||
|
|
dffb1c79ec | ||
|
|
46cc9f0b6e | ||
|
|
140e9f0b20 | ||
|
|
0fe5779c4b | ||
|
|
06b1475b63 | ||
|
|
6bc415120d | ||
|
|
e061540e6b | ||
|
|
38bf31a67f | ||
|
|
7cee9f04cf |
@@ -26,7 +26,9 @@
|
||||
"extensions": [
|
||||
"hbenl.vscode-mocha-test-adapter",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"unifiedjs.vscode-mdx"
|
||||
"unifiedjs.vscode-mdx",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"TakumiI.markdowntable"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -12,8 +12,10 @@ jobs:
|
||||
name: Deploy to GitHub Pages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 #v4.3.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #4.4.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -41,7 +43,7 @@ jobs:
|
||||
# Popular action to deploy to GitHub Pages:
|
||||
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 #3.9.3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Build output to publish to the `gh-pages` branch:
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
permissions:
|
||||
packages: write
|
||||
steps:
|
||||
- uses: dataaxiom/ghcr-cleanup-action@v1
|
||||
- uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 #1.0.16
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
+29
-16
@@ -48,10 +48,13 @@ jobs:
|
||||
# list all registries to push to and join all non-empty with comma
|
||||
# https://unix.stackexchange.com/a/693165/116849
|
||||
# https://stackoverflow.com/a/9429887/1469797
|
||||
strings=("${{vars.DOCKERHUB_SLUG}}" "${{vars.GHCR_SLUG}}")
|
||||
strings=("${VARS_DOCKERHUB_SLUG}" "${VARS_GHCR_SLUG}")
|
||||
for i in ${!strings[@]}; do [[ -z ${strings[i]} ]] && unset strings[i]; done
|
||||
joined_string=$(IFS=, ; echo "${strings[*]}")
|
||||
echo "REGISTRIES_JOINED=$joined_string" >> $GITHUB_ENV
|
||||
env:
|
||||
VARS_DOCKERHUB_SLUG: ${{ vars.DOCKERHUB_SLUG }}
|
||||
VARS_GHCR_SLUG: ${{vars.GHCR_SLUG}}
|
||||
|
||||
# do not use here!
|
||||
# instead we can specify repo#sha in build-push-action so we only deal with foreign SHA for actually building image
|
||||
@@ -73,14 +76,14 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: ${{ vars.DOCKERHUB_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: ${{ vars.GHCR_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -89,13 +92,13 @@ jobs:
|
||||
# metadata extract for docker labels/image names is done in merge job
|
||||
|
||||
- name: Set up Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
|
||||
|
||||
# https://github.com/docker/build-push-action/issues/671#issuecomment-1619353328
|
||||
# for caching
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
|
||||
with:
|
||||
# specify foreign repo#sha from PR that is used to build image
|
||||
context: ${{github.event.pull_request.head.repo.clone_url}}#${{github.event.pull_request.head.sha}}
|
||||
@@ -114,7 +117,7 @@ jobs:
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2
|
||||
with:
|
||||
name: digests-${{ env.PLATFORM_PAIR }}
|
||||
path: /tmp/digests/*
|
||||
@@ -133,7 +136,7 @@ jobs:
|
||||
- test
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 #4.3.0
|
||||
with:
|
||||
path: /tmp/digests
|
||||
pattern: digests-*
|
||||
@@ -141,25 +144,25 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: ${{ vars.DOCKERHUB_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: ${{ vars.GHCR_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
||||
|
||||
- name: Extract metadata (tags, labels)
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 #5.9.0
|
||||
with:
|
||||
images: |
|
||||
${{ vars.DOCKERHUB_SLUG }}
|
||||
@@ -180,24 +183,34 @@ jobs:
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ vars.DOCKERHUB_SLUG }}@sha256:%s ' *)
|
||||
$(printf "${VARS_DOCKERHUB_SLUG}@sha256:%s " *)
|
||||
env:
|
||||
VARS_DOCKERHUB_SLUG: ${{ vars.DOCKERHUB_SLUG }}
|
||||
|
||||
- name: Create manifest list and push gchr
|
||||
if: ${{ vars.GHCR_SLUG != '' }}
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ vars.GHCR_SLUG }}@sha256:%s ' *)
|
||||
$(printf "${VARS_GHCR_SLUG}@sha256:%s " *)
|
||||
env:
|
||||
VARS_GHCR_SLUG: ${{ vars.GHCR_SLUG }}
|
||||
|
||||
- name: Inspect image dockerhub
|
||||
if: ${{ vars.DOCKERHUB_SLUG != '' }}
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ vars.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker buildx imagetools inspect ${VARS_DOCKERHUB_SLUG}:${STEPS_META_OUTPUTS_VERSION}
|
||||
env:
|
||||
VARS_DOCKERHUB_SLUG: ${{ vars.DOCKERHUB_SLUG }}
|
||||
STEPS_META_OUTPUTS_VERSION: ${{ steps.meta.outputs.version }}
|
||||
|
||||
- name: Inspect image ghcr
|
||||
if: ${{ vars.GHCR_SLUG != '' }}
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ vars.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker buildx imagetools inspect ${VARS_GHCR_SLUG}:${STEPS_META_OUTPUTS_VERSION}
|
||||
env:
|
||||
VARS_GHCR_SLUG: ${{ vars.GHCR_SLUG }}
|
||||
STEPS_META_OUTPUTS_VERSION: ${{ steps.meta.outputs.version }}
|
||||
|
||||
|
||||
combine-and-comment:
|
||||
@@ -207,7 +220,7 @@ jobs:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 #2.9.4
|
||||
with:
|
||||
recreate: true
|
||||
header: "pr-release"
|
||||
|
||||
@@ -62,13 +62,19 @@ jobs:
|
||||
# list all registries to push to and join all non-empty with comma
|
||||
# https://unix.stackexchange.com/a/693165/116849
|
||||
# https://stackoverflow.com/a/9429887/1469797
|
||||
strings=("${{vars.DOCKERHUB_SLUG}}" "${{vars.GHCR_SLUG}}")
|
||||
strings=("${VARS_DOCKERHUB_SLUG}" "${VARS_GHCR_SLUG}")
|
||||
for i in ${!strings[@]}; do [[ -z ${strings[i]} ]] && unset strings[i]; done
|
||||
joined_string=$(IFS=, ; echo "${strings[*]}")
|
||||
echo "REGISTRIES_JOINED=$joined_string" >> $GITHUB_ENV
|
||||
env:
|
||||
VARS_DOCKERHUB_SLUG: ${{ vars.DOCKERHUB_SLUG }}
|
||||
VARS_GHCR_SLUG: ${{vars.GHCR_SLUG}}
|
||||
|
||||
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 #v4.3.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set short git commit SHA
|
||||
id: appvars
|
||||
@@ -94,14 +100,14 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: ${{ github.event_name != 'pull_request' && vars.DOCKERHUB_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: ${{ github.event_name != 'pull_request' && vars.GHCR_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -110,13 +116,13 @@ jobs:
|
||||
# metadata extract for docker labels/image names is done in merge job
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
|
||||
|
||||
# https://github.com/docker/build-push-action/issues/671#issuecomment-1619353328
|
||||
# for caching
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
|
||||
with:
|
||||
build-args: |
|
||||
APP_BUILD_VERSION=${{steps.appversion.outputs.appversion}}
|
||||
@@ -129,11 +135,12 @@ jobs:
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
digest="${VARS_DIGEST}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
env:
|
||||
VARS_DIGEST: ${{ steps.build.outputs.digest }}
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2
|
||||
with:
|
||||
name: digests-${{ env.PLATFORM_PAIR }}
|
||||
path: /tmp/digests/*
|
||||
@@ -152,7 +159,7 @@ jobs:
|
||||
- test
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 #4.3.0
|
||||
with:
|
||||
path: /tmp/digests
|
||||
pattern: digests-*
|
||||
@@ -160,25 +167,25 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: ${{ github.event_name != 'pull_request' && vars.DOCKERHUB_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: ${{ github.event_name != 'pull_request' && vars.GHCR_SLUG != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
||||
|
||||
- name: Extract metadata (tags, labels)
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 #5.9.0
|
||||
with:
|
||||
images: |
|
||||
${{ vars.DOCKERHUB_SLUG }}
|
||||
@@ -208,21 +215,31 @@ jobs:
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ vars.DOCKERHUB_SLUG }}@sha256:%s ' *)
|
||||
$(printf "${VARS_DOCKERHUB_SLUG}@sha256:%s " *)
|
||||
env:
|
||||
VARS_DOCKERHUB_SLUG: ${{ vars.DOCKERHUB_SLUG }}
|
||||
|
||||
- name: Create manifest list and push gchr
|
||||
if: ${{ vars.GHCR_SLUG != '' }}
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ vars.GHCR_SLUG }}@sha256:%s ' *)
|
||||
$(printf "${VARS_GHCR_SLUG}@sha256:%s " *)
|
||||
env:
|
||||
VARS_GHCR_SLUG: ${{ vars.GHCR_SLUG }}
|
||||
|
||||
- name: Inspect image dockerhub
|
||||
if: ${{ vars.DOCKERHUB_SLUG != '' }}
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ vars.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker buildx imagetools inspect ${VARS_DOCKERHUB_SLUG}:${STEPS_META_OUTPUTS_VERSION}
|
||||
env:
|
||||
VARS_DOCKERHUB_SLUG: ${{ vars.DOCKERHUB_SLUG }}
|
||||
STEPS_META_OUTPUTS_VERSION: ${{ steps.meta.outputs.version }}
|
||||
|
||||
- name: Inspect image ghcr
|
||||
if: ${{ vars.GHCR_SLUG != '' }}
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ vars.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker buildx imagetools inspect ${VARS_GHCR_SLUG}:${STEPS_META_OUTPUTS_VERSION}
|
||||
env:
|
||||
VARS_GHCR_SLUG: ${{ vars.GHCR_SLUG }}
|
||||
STEPS_META_OUTPUTS_VERSION: ${{ steps.meta.outputs.version }}
|
||||
@@ -19,11 +19,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 #v4.3.0
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
persist-credentials: false
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #4.4.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: 'npm'
|
||||
|
||||
@@ -122,6 +122,7 @@ config/mscache
|
||||
config/yti-*
|
||||
config/*.cache
|
||||
*.txt
|
||||
!robots.txt
|
||||
.idea/
|
||||
|
||||
src/**/**.js
|
||||
|
||||
Vendored
+12
-1
@@ -1,5 +1,16 @@
|
||||
{
|
||||
"mochaExplorer.require": "tsx/esm",
|
||||
"mochaExplorer.timeout": 1200000,
|
||||
"mochaExplorer.exit": true
|
||||
"mochaExplorer.exit": true,
|
||||
"search.exclude": {
|
||||
"**/.docusaurus": true,
|
||||
"**/build": true
|
||||
},
|
||||
"tailwindCSS.files.exclude": [
|
||||
"docsite/**"
|
||||
],
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss"
|
||||
},
|
||||
"tailwindCSS.experimental.configFile": "src/client/index.css"
|
||||
}
|
||||
@@ -9,48 +9,53 @@
|
||||
<img src="/assets/icon.png" align="right"
|
||||
alt="multi-scrobbler logo" width="180" height="180">
|
||||
|
||||
A javascript app to scrobble music you listened to, to [Maloja](https://github.com/krateng/maloja), [Last.fm](https://www.last.fm), and [ListenBrainz](https://listenbrainz.org)
|
||||
A javascript app to scrobble music you listen to, to [Maloja](https://github.com/krateng/maloja), [Last.fm](https://www.last.fm), [ListenBrainz](https://listenbrainz.org), and other services.
|
||||
|
||||
* Supports scrobbling from many **Sources**
|
||||
* [Azuracast](https://foxxmd.github.io/multi-scrobbler/docs/configuration#azuracast)
|
||||
* [Deezer](https://foxxmd.github.io/multi-scrobbler/docs/configuration#deezer)
|
||||
* [Google Cast (Chromecast)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#google-cast-chromecast)
|
||||
* [Icecast](https://foxxmd.github.io/multi-scrobbler/docs/configuration#icecast)
|
||||
* [Jellyfin](https://foxxmd.github.io/multi-scrobbler/docs/configuration#jellyfin)
|
||||
* [JRiver](https://foxxmd.github.io/multi-scrobbler/docs/configuration#jriver)
|
||||
* [Kodi](https://foxxmd.github.io/multi-scrobbler/docs/configuration#kodi)
|
||||
* [Koito](https://foxxmd.github.io/multi-scrobbler/docs/configuration#koito-source)
|
||||
* [Last.fm](https://foxxmd.github.io/multi-scrobbler/docs/configuration#lastfm-source)
|
||||
* [Last.fm (Endpoint)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#lastfm-endpoint)
|
||||
* [ListenBrainz](https://foxxmd.github.io/multi-scrobbler/docs/configuration#listenbrainz-source)
|
||||
* [ListenBrainz (Endpoint)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#listenbrainz-endpoint)
|
||||
* [Maloja](https://foxxmd.github.io/multi-scrobbler/docs/configuration#maloja-source)
|
||||
* [Mopidy](https://foxxmd.github.io/multi-scrobbler/docs/configuration#mopidy)
|
||||
* [MPD (Music Player Daemon)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#mpd-music-player-daemon)
|
||||
* [MPRIS (Linux Desktop)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#mpris)
|
||||
* [Musikcube](https://foxxmd.github.io/multi-scrobbler/docs/configuration#muikcube)
|
||||
* [Plex](https://foxxmd.github.io/multi-scrobbler/docs/configuration#plex) or [~~Tautulli~~](https://foxxmd.github.io/multi-scrobbler/docs/configuration#tautulli)
|
||||
* [Spotify](https://foxxmd.github.io/multi-scrobbler/docs/configuration#spotify)
|
||||
* [Subsonic-compatible APIs](https://foxxmd.github.io/multi-scrobbler/docs/configuration#subsonic) (like [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))
|
||||
* [WebScrobbler](https://foxxmd.github.io/multi-scrobbler/docs/configuration#webscrobbler)
|
||||
* [VLC](https://foxxmd.github.io/multi-scrobbler/docs/configuration#vlc)
|
||||
* [Yamaha MusicCast](https://foxxmd.github.io/multi-scrobbler/docs/configuration#yamaha-musiccast)
|
||||
* [Youtube Music](https://foxxmd.github.io/multi-scrobbler/docs/configuration#youtube-music)
|
||||
* Supports scrobbling to many **Clients**
|
||||
* [Koito](https://foxxmd.github.io/multi-scrobbler/docs/configuration#koito)
|
||||
* [Last.fm](https://foxxmd.github.io/multi-scrobbler/docs/configuration#lastfm)
|
||||
* [ListenBrainz](https://foxxmd.github.io/multi-scrobbler/docs/configuration#listenbrainz)
|
||||
* [Maloja](https://foxxmd.github.io/multi-scrobbler/docs/configuration#maloja)
|
||||
* Monitor status of Sources and Clients using [webhooks (Gotify, Ntfy, Apprise)](https://foxxmd.github.io/multi-scrobbler/docs/configuration#webhook-configurations) or [healthcheck endpoint](https://foxxmd.github.io/multi-scrobbler/docs/configuration#health-endpoint)
|
||||
* Supports scrobbling from many [**Sources**](https://foxxmd.github.io/multi-scrobbler/configuration/sources)
|
||||
* [Azuracast](https://foxxmd.github.io/multi-scrobbler/configuration/sources/azuracast)
|
||||
* [Deezer](https://foxxmd.github.io/multi-scrobbler/configuration/sources/deezer)
|
||||
* [Google Cast (Chromecast)](https://foxxmd.github.io/multi-scrobbler/configuration/sources/google-cast)
|
||||
* [Icecast](https://foxxmd.github.io/multi-scrobbler/configuration/sources/icecast)
|
||||
* [Jellyfin](https://foxxmd.github.io/multi-scrobbler/configuration/sources/jellyfin)
|
||||
* [JRiver](https://foxxmd.github.io/multi-scrobbler/configuration/sources/jriver)
|
||||
* [Kodi](https://foxxmd.github.io/multi-scrobbler/configuration/sources/kodi)
|
||||
* [Koito](https://foxxmd.github.io/multi-scrobbler/configuration/sources/koito-source)
|
||||
* [Last.fm](https://foxxmd.github.io/multi-scrobbler/configuration/sources/lastfm-source)
|
||||
* [Last.fm (Endpoint)](https://foxxmd.github.io/multi-scrobbler/configuration/sources/lastfm-endpoint)
|
||||
* [ListenBrainz](https://foxxmd.github.io/multi-scrobbler/configuration/sources/listenbrainz-source)
|
||||
* [ListenBrainz (Endpoint)](https://foxxmd.github.io/multi-scrobbler/configuration/sources/listenbrainz-endpoint)
|
||||
* [Maloja](https://foxxmd.github.io/multi-scrobbler/configuration/sources/maloja)
|
||||
* [Mopidy](https://foxxmd.github.io/multi-scrobbler/configuration/sources/mopidy)
|
||||
* [MPD (Music Player Daemon)](https://foxxmd.github.io/multi-scrobbler/configuration/sources/mpd)
|
||||
* [MPRIS (Linux Desktop)](https://foxxmd.github.io/multi-scrobbler/configuration/sources/mpris)
|
||||
* [Musikcube](https://foxxmd.github.io/multi-scrobbler/configuration/sources/musikcube)
|
||||
* [Plex](https://foxxmd.github.io/multi-scrobbler/configuration/sources/plex)
|
||||
* [Rocksky](https://foxxmd.github.io/multi-scrobbler/configuration/sources/rocksky-source)
|
||||
* [Spotify](https://foxxmd.github.io/multi-scrobbler/configuration/sources/spotify)
|
||||
* [Subsonic-compatible APIs](https://foxxmd.github.io/multi-scrobbler/configuration/sources/subsonic) (like [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))
|
||||
* [teal.fm](https://foxxmd.github.io/multi-scrobbler/configuration/sources/tealfm-source)
|
||||
* [WebScrobbler](https://foxxmd.github.io/multi-scrobbler/configuration/sources/webscrobbler)
|
||||
* [VLC](https://foxxmd.github.io/multi-scrobbler/configuration/sources/vlc)
|
||||
* [Yamaha MusicCast](https://foxxmd.github.io/multi-scrobbler/configuration/sources/yamaha-musiccast)
|
||||
* [Youtube Music](https://foxxmd.github.io/multi-scrobbler/configuration/sources/youtube-music)
|
||||
* Supports scrobbling to many [**Clients**](https://foxxmd.github.io/multi-scrobbler/configuration/clients)
|
||||
* [Koito](https://foxxmd.github.io/multi-scrobbler/configuration/clients/koito)
|
||||
* [Last.fm](https://foxxmd.github.io/multi-scrobbler/configuration/clients/lastfm)
|
||||
* [ListenBrainz](https://foxxmd.github.io/multi-scrobbler/configuration/clients/listenbrainz)
|
||||
* [Maloja](https://foxxmd.github.io/multi-scrobbler/configuration/clients/maloja)
|
||||
* [Rocksky](https://foxxmd.github.io/multi-scrobbler/configuration/clients/rocksky)
|
||||
* [teal.fm](https://foxxmd.github.io/multi-scrobbler/configuration/clients/tealfm)
|
||||
* Monitor status of Sources and Clients using [webhooks (Gotify, Ntfy, Apprise)](https://foxxmd.github.io/multi-scrobbler/configuration#webhook-configurations) or [healthcheck endpoint](https://foxxmd.github.io/multi-scrobbler/configuration#health-endpoint)
|
||||
* Supports [Now Playing](https://foxxmd.github.io/multi-scrobbler/configuration/clients#now-playing) for scrobble Clients
|
||||
* Supports configuring for single or multiple users (scrobbling for your friends and family!)
|
||||
* Web server interface for stats, basic control, and detailed logs
|
||||
* Graceful network and client failure handling (queued scrobbles that auto-retry)
|
||||
* Smart handling of credentials (persistent, authorization through app)
|
||||
* Easy configuration through ENVs or JSON
|
||||
* Modify data before scrobbling with [regular expression or search patterns](https://foxxmd.github.io/multi-scrobbler/docs/configuration/transforms)
|
||||
* Install using [Docker images for x86/ARM](https://foxxmd.github.io/multi-scrobbler/docs/installation#docker) or [locally with NodeJS](https://foxxmd.github.io/multi-scrobbler/docs/installation#nodejs)
|
||||
* Easy configuration through [ENVs or JSON](ttps://foxxmd.github.io/multi-scrobbler/configuration#configuration-types)
|
||||
* Modify data before scrobbling with [regular expression or search patterns](https://foxxmd.github.io/multi-scrobbler/configuration/transforms)
|
||||
* Install using [Docker images for x86/ARM](https://foxxmd.github.io/multi-scrobbler/installation#docker) or [locally with NodeJS](https://foxxmd.github.io/multi-scrobbler/installation#nodejs)
|
||||
|
||||
[**Quick Start Guide**](https://foxxmd.github.io/multi-scrobbler/docs/quickstart)
|
||||
[**Quick Start Guide**](https://foxxmd.github.io/multi-scrobbler//quickstart)
|
||||
|
||||
<img src="/assets/status-ui.png" width="800">
|
||||
|
||||
@@ -63,15 +68,15 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
|
||||
|
||||
**But I already scrobble my music to Last.fm/ListenBrainz, is multi-scrobbler for me?**
|
||||
|
||||
Yes! You can use [Last.fm as a **Source**](https://foxxmd.github.io/multi-scrobbler/docs/configuration#lastfm-source) or [Listenbrainz as a **Source**](https://foxxmd.github.io/multi-scrobbler/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.
|
||||
Yes! You can use [Last.fm as a **Source**](https://foxxmd.github.io/multi-scrobbler/configuration/sources/lastfm-source) or [Listenbrainz as a **Source**](https://foxxmd.github.io/multi-scrobbler/configuration/sources/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.
|
||||
|
||||
## How Does multi-scrobbler (MS) Work?
|
||||
|
||||
You set up configurations for one or more **Sources** and one or more **Clients**. MS monitors all of your configured **Sources**. When new tracks are played by a Source it grabs that information and then sends it (scrobbles it) to all **Clients** that Source is configured to scrobble to.
|
||||
You set up [configurations](https://foxxmd.github.io/multi-scrobbler/configuration) for one or more [**Sources**](https://foxxmd.github.io/multi-scrobbler/configuration/sources) and one or more [**Clients**](https://foxxmd.github.io/multi-scrobbler/configuration/clients). MS monitors all of your configured **Sources**. When new tracks are played by a Source MS grabs that information and then sends it (scrobbles it) to all **Clients** that Source is configured to forward to.
|
||||
|
||||
### Source
|
||||
|
||||
A **Source** is a data source that contains information about tracks you are playing like a music player or platform. Examples are **Spotify, Jellyfin, Plex, Youtube Music, Airsonic**, etc...
|
||||
A [**Source**](https://foxxmd.github.io/multi-scrobbler/configuration/sources) is a data source that contains information about music you are playing or have listened to, like a desktop player, web music player, or cloud music service. Examples are **Spotify, Jellyfin, Plex, Youtube Music, Navidrome**, etc...
|
||||
|
||||
Source configurations consist of:
|
||||
|
||||
@@ -81,7 +86,7 @@ Source configurations consist of:
|
||||
|
||||
### Client
|
||||
|
||||
A **Client** is an application that stores the historical information about what songs you have played (scrobbles). Examples are **Maloja, Last.fm, Listenbrainz**...
|
||||
A [**Client**](https://foxxmd.github.io/multi-scrobbler/configuration/clients) is an application that stores the historical information about what music you have played (scrobbles). Examples are **Maloja, Last.fm, Listenbrainz**...
|
||||
|
||||
Client configurations consist of:
|
||||
|
||||
@@ -90,15 +95,15 @@ Client configurations consist of:
|
||||
|
||||
## Quick Start
|
||||
|
||||
[See the **Quick Start Guide**](https://foxxmd.github.io/multi-scrobbler/docs/quickstart)
|
||||
[See the **Quick Start Guide**](https://foxxmd.github.io/multi-scrobbler/quickstart)
|
||||
|
||||
## Installation
|
||||
|
||||
[See the **Installation** documentation](https://foxxmd.github.io/multi-scrobbler/docs/installation)
|
||||
[See the **Installation** documentation](https://foxxmd.github.io/multi-scrobbler/installation)
|
||||
|
||||
## Configuration
|
||||
|
||||
[See the **Configuration** documentation](https://foxxmd.github.io/multi-scrobbler/docs/configuration)
|
||||
[See the **Configuration** documentation](https://foxxmd.github.io/multi-scrobbler/configuration)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -113,11 +118,11 @@ On first startup you may need to authorize Spotify and/or Last.fm by visiting th
|
||||
|
||||
## Help/FAQ
|
||||
|
||||
Having issues with connections or configuration? Check the [FAQ](https://foxxmd.github.io/multi-scrobbler/docs/FAQ) before creating an issue!
|
||||
Having issues with connections or configuration? Check the [FAQ](https://foxxmd.github.io/multi-scrobbler/FAQ) before creating an issue!
|
||||
|
||||
## Development
|
||||
|
||||
[Detailed architecture and development guides for Sources/Clients](https://foxxmd.github.io/multi-scrobbler/docs/development/dev-common)
|
||||
[Detailed architecture and development guides for Sources/Clients](https://foxxmd.github.io/multi-scrobbler/development/dev-common)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"configureAs": "client",
|
||||
"data": {
|
||||
"token": "029b081ba-9156-4pe7-88e5-3be671f5ea2b",
|
||||
"username": "FoxxMD"
|
||||
"username": "FoxxMD",
|
||||
"url": "https://api.listenbrainz.org"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -14,7 +15,8 @@
|
||||
"configureAs": "source",
|
||||
"data": {
|
||||
"token": "029b081ba-9156-4pe7-88e5-3be671f5ea2b",
|
||||
"username": "FoxxMD"
|
||||
"username": "FoxxMD",
|
||||
"url": "https://api.listenbrainz.org"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
},
|
||||
"options": {
|
||||
"logPayload": true,
|
||||
"logFilterFailure": "debug"
|
||||
"logFilterFailure": "debug",
|
||||
"ignoreInvalidCert": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "myRockskyClient",
|
||||
"configureAs": "client",
|
||||
"data": {
|
||||
"key": "7cdr86vis3mpq5b1pi01md0hkm7ykzzxjy81r",
|
||||
"handle": "alice.bsky.social"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "myRockskySource",
|
||||
"configureAs": "source",
|
||||
"data": {
|
||||
"key": "e4xwktm7jxm607x8el1fcda30eu14dzb64h3j",
|
||||
"handle": "alice.bsky.social"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "myTeal",
|
||||
"configureAs": "client",
|
||||
"data": {
|
||||
"identifier": "alice.bsky.social",
|
||||
"appPassword": "twog-phu7-4dhe-y4j3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "myTealSource",
|
||||
"configureAs": "source",
|
||||
"data": {
|
||||
"identifier": "alice.bsky.social",
|
||||
"appPassword": "twog-phu7-4dhe-y4j3"
|
||||
}
|
||||
}
|
||||
]
|
||||
+8
-8
@@ -33,7 +33,7 @@ First, turn on **debug** logging for multi-scrobbler by setting the environmenta
|
||||
|
||||
##### Check Host name and URL
|
||||
|
||||
The URLs examples in the [configuration](configuration/configuration.mdx) documentation assume you are running Webscrobbler/LFM Endpoint on the same server as multi-scrobbler. If these are not the same machine then you need to determine the IP address or domain name that multi-scrobbler is reachable at and use that instead of `localhost` when configuring these sources. **This is likely the same host name that you would use to access the web interface for multi-scrobbler.**
|
||||
The URLs examples in the [configuration](/configuration#base-url) documentation assume you are running Webscrobbler/LFM Endpoint on the same server as multi-scrobbler. If these are not the same machine then you need to determine the IP address or domain name that multi-scrobbler is reachable at and use that instead of `localhost` when configuring these sources. **This is likely the same host name that you would use to access the web interface for multi-scrobbler.**
|
||||
|
||||
EX `http://localhost:9078/api/webscrobbler` -> `http://192.168.0.140:9078/api/webscrobbler`
|
||||
|
||||
@@ -70,7 +70,7 @@ Error: Could not send the specified request to browse. Status code: 401
|
||||
|
||||
then YTM has invalidated your authentication.
|
||||
|
||||
First, ensure you are NOT using [YoutubeTV authentication.](configuration/configuration.mdx?ytmAuth=ytt#youtube-music) If you completed authentication by entering a "User Code" you are using YoutubeTV which has stopped working. You should reauthenticate using **Cookies** or **Custom OAuth.**
|
||||
First, ensure you are NOT using [YoutubeTV authentication.](/configuration/sources/youtube-music?ytmAuth=ytt#authentication) If you completed authentication by entering a "User Code" you are using YoutubeTV which has stopped working. You should reauthenticate using **Cookies** or **Custom OAuth.**
|
||||
|
||||
#### When using OAuth Client Authentication
|
||||
|
||||
@@ -80,7 +80,7 @@ Refresh your authentication by using the **(Re)authenticate** link from MS's web
|
||||
|
||||
The library MS uses relies on scraping the YTM site by using cookies from your actual browser to pretend it is a browser. It does its best to keep these up to date but since this is not an official way to access the service YTM may invalidate your access _to the authenticated session_ at any time. How this is triggered is unknown and not something multi-scrobbler can control. You can help limit the chance of your session being invalidated by [getting the cookie from an Incognito/Private Session](https://github.com/LuanRT/YouTube.js/issues/803#issuecomment-2504032666) and then immediately closing the browser afterwards.
|
||||
|
||||
To re-authenticate MS [follow the YTM instructions to retrieve a new set of cookies for multi-scrobbler](configuration/configuration.mdx?ytmAuth=cookie#youtube-music) and then restart MS to potentially resolve the problem.
|
||||
To re-authenticate MS [follow the YTM instructions to retrieve a new set of cookies for multi-scrobbler](/configuration/sources/youtube-music?ytmAuth=cookie#authentication) and then restart MS to potentially resolve the problem.
|
||||
|
||||
## Configuration Issues
|
||||
|
||||
@@ -108,7 +108,7 @@ Multi-scrobbler works the same was the official Spotify-Last.fm integration work
|
||||
|
||||
The Google Cast integration relies on a few common fields in the data it receives from your casting device. Every platform that can cast (Spotify, Pandora, etc...) *should* use these fields the same but there are slight differences between their implementations that may confuse multi-scrobbler. Specific platforms may also return more information in non-common fields that are undocumented.
|
||||
|
||||
To diagnose these issues you [**must enable payload logging**](configuration/configuration.mdx#cast-troubleshooting) for your google cast Source, run MS, and then include logs with this output from that run. Without the raw data logged from your cast device it will be nearly impossible to resolve your issue.
|
||||
To diagnose these issues you [**must enable payload logging**](/configuration/sources/google-cast#cast-troubleshooting) for your google cast Source, run MS, and then include logs with this output from that run. Without the raw data logged from your cast device it will be nearly impossible to resolve your issue.
|
||||
|
||||
### Google Cast device does not track media
|
||||
|
||||
@@ -120,17 +120,17 @@ MS logs will tell you what type the media is reported as with lines like:
|
||||
My Artist - Example Track has 'unknown' media type and allowUnknownMedia=false, will not track
|
||||
```
|
||||
|
||||
Refer to [Allow Unknown Media Type](configuration/configuration.mdx#allow-unknown-media-type) section to fix this
|
||||
Refer to [Allow Unknown Media Type](/configuration/sources/google-cast#allow-unknown-media-type) section to fix this
|
||||
|
||||
```
|
||||
My Artist - Example Track has 'movie' media type so will not track
|
||||
```
|
||||
|
||||
Refer to [Force Media Tracking](configuration/configuration.mdx#forcing-media-tracking) section to fix this
|
||||
Refer to [Force Media Tracking](/configuration/sources/google-cast#forcing-media-tracking) section to fix this
|
||||
|
||||
### VLC is not scrobbling fields correctly
|
||||
|
||||
Before reporting an issue turn on metadata logging in the MS VLC configuration, [see the VLC documentation.](configuration/configuration.mdx#vlc-information-reporting)
|
||||
Before reporting an issue turn on metadata logging in the MS VLC configuration, [see the VLC documentation.](/configuration/sources/vlc#vlc-information-reporting)
|
||||
|
||||
### Youtube Music misses or duplicates scrobbles
|
||||
|
||||
@@ -169,7 +169,7 @@ In your YTM configuration (`ytmusic.json`) add `logDiff` under `options` like th
|
||||
or set either ENVs:
|
||||
|
||||
* `YTM_LOG_DIFF=true`
|
||||
* [`DEBUG_MODE=true`](configuration/configuration.mdx?#debug-mode)
|
||||
* [`DEBUG_MODE=true`](/configuration#debug-mode)
|
||||
|
||||
This will cause MS to log YTM history changes similar to this:
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"label": "Configuration",
|
||||
"position": 4,
|
||||
"position": 5,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Configuring Multi-Scrobbler and examples"
|
||||
"type": "doc",
|
||||
"id": "configuration/configuration"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "Scrobble Clients",
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "configuration/clients/clients"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
title: Overview
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
import ScrobbleThreshold from "@site/src/components/snippets/_scrobble-threshold.mdx"
|
||||
|
||||
A **Client** is an application that stores the historical information about what songs you have played (scrobbles). Examples are **Maloja, Last.fm, Listenbrainz**...
|
||||
|
||||
## Clients
|
||||
|
||||
| Name | Now Playing |
|
||||
| :-------------------------------------------------- | :---------- |
|
||||
| [Last.fm](/configuration/clients/lastfm) | ✅ |
|
||||
| [Listenbrainz](/configuration/clients/listenbrainz) | ✅ |
|
||||
| [Koito](/configuration/clients/koito) | ❌ |
|
||||
| [Maloja](/configuration/clients/maloja) | ❌ |
|
||||
| [Rocksky](/configuration/clients/rocksky) | ❌ |
|
||||
| [Teal.fm](/configuration/clients/tealfm) | ❌ |
|
||||
|
||||
## Features
|
||||
|
||||
### Dead Scrobbles
|
||||
|
||||
If multi-scrobbler is unable to submit a scrobble to a Client then it places the scrobble into a queue which is retried every 5 minutes for a number of times before it gives up.
|
||||
|
||||
After it stops _automatically_ retrying the scrobble still exists and can be retried from the dashboard. Dead scrobbles persist between restart so you will never lose a scrobble that hasn't been successfully submitted yet.
|
||||
|
||||
### Now Playing
|
||||
|
||||
Multi-scrobbler can report the currently **playing** tracks it is monitoring to some Scrobble Clients via their individual **Now Playing** functionality.
|
||||
|
||||
Now Playing is **default enabled** for all Clients that support it.
|
||||
|
||||
The behavior multi-scrobbler uses for determining Now Playing reporting:
|
||||
|
||||
* Now Playing can be explicitly enabled or disabled globally using ENV `NOW_PLAYING=true` or `NOW_PLAYING=false`
|
||||
* This only affects Clients that don't have behavior set via File/AIO (below)
|
||||
* Now Playing will be only be reported to the same Clients a Source is configured to scrobble to
|
||||
* A Source's Player status must be **Playing**, IE **active**, for reporting to occur
|
||||
* This status can be verified via Player UI on the Dashboard
|
||||
* If multiple Sources having active Players then the scrobble Client will default to reporting the track based on Source **configuration** name, alphabetically
|
||||
* This is the `name` property set in [File or AIO source configs](/configuration?configType=file#configuration-types)
|
||||
|
||||
Clients can customize the Now Playing behavior individually using [File or AIO source configs:](/configuration?configType=file#configuration-types)
|
||||
|
||||
```json5 title="CONFIG_DIR/lastfm.json"
|
||||
[
|
||||
{
|
||||
"name": "myLastFmClient",
|
||||
"configureAs": "client",
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
"options": {
|
||||
// disable or enable
|
||||
//"nowPlaying": true
|
||||
//
|
||||
// OR define a list of Source *config* names that should be allowed to report Now Playing
|
||||
// order of the list determines priority for reporting Now Playing
|
||||
//"nowPlaying": ["mySpotify1","myJellyfin2"]
|
||||
}
|
||||
},
|
||||
]
|
||||
```
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: Koito
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/koito.json.example';
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
To monitor and re-scrobble activity from a Koito account create a [Koito (Source)](/configuration/sources/koito-source)
|
||||
|
||||
:::
|
||||
|
||||
Setup a [Koito server](https://koito.io/guides/installation/) if you have not already done this.
|
||||
|
||||
* [Create (or get) an API Key](https://koito.io/guides/scrobbler/)
|
||||
* From your Koito server dashboard navigate to **Settings** (bottom-left icon) => **API Keys**
|
||||
* Create a new Key (or use an existing) and Copy the key using the copy icon to the right of the key
|
||||
* EX `pM195xPV98CDpk0QW47FIIOR8AKATAX5DblBF-Jq0t1MbbKL`
|
||||
* Take note of your Koito username (used below as `KOITO_USER`)
|
||||
* Determine your Koito URL
|
||||
* This is the URL you use to access your Koito dashboard OR whatever URL is accessible from your multi-scrobbler instance.
|
||||
* EX dashboard at `http://192.168.0.100:4110` => `KOITO_URL` is set to `http://192.168.0.100:4110`
|
||||
|
||||
:::note[Koito Base URL]
|
||||
|
||||
Using the URL path `/apis/listenbrainz` [Koito docs describe](https://koito.io/guides/scrobbler/) **is not required.** The Koito URL used for multi-scrobbler should only be the **base** URL. Only include a URL path if your Koito **base** url is not at `host:port`. See the table below for examples.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Base URL Examples</summary>
|
||||
| `KOITO_URL` | MS Detected Base URL | Example Scrobble Api URL |
|
||||
| :-------------------------------------------- | :------------------------------ | ---------------------------------------------------- |
|
||||
| `http://192.168.0.100:4110` | `http://192.168.0.100:4110` | `http://192.168.0.100:4110/apis/listenbrainz/1` |
|
||||
| `https://koito.mydomain.com` | `https://koito.mydomain.com` | `https://koito.mydomain.com/apis/listenbrainz/1` |
|
||||
| `http://192.168.0.100:4110/apis/listenbrainz` | `http://192.168.0.100:4110` | `http://192.168.0.100:4110/apis/listenbrainz/1` |
|
||||
| `http://192.168.0.100:80/koito` | `http://192.168.0.100:80/koito` | `http://192.168.0.100:80/koito/apis/listenbrainz/1` |
|
||||
</details>
|
||||
:::
|
||||
|
||||
|
||||
:::tip
|
||||
|
||||
Ensure that Koito is configured to allow requests from multi-scrobbler! In Koito config set [`KOITO_ALLOWED_HOSTS`](https://koito.io/reference/configuration/#koito_allowed_hosts) to the IP the multi-scrobbler dashboard is accessible from.
|
||||
|
||||
:::
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="KoitoClientConfig" fileContent={JsonConfig} client name="koito">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | --------- | ------- | --------------------------------- |
|
||||
| KOITO_TOKEN | Yes | | API Key from your Koito Account |
|
||||
| KOITO_USER | Yes | | Your Koito username |
|
||||
| KOITO_URL | No | | The base URL for the Koito server |
|
||||
</Config>
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Last.fm
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/lastfm.json.example';
|
||||
|
||||
:::tip[Other Users]
|
||||
|
||||
* To monitor and re-scrobble activity from your Last.fm account create a [Last.fm (Source)](/configuration/sources/lastfm-source)
|
||||
* To accept scrobbles from outside applications as if multi-scrobbler was Last.fm, create a [Last.fm (Endpoint)](/configuration/sources/lastfm-endpoint)
|
||||
|
||||
:::
|
||||
|
||||
[Register for an API account here.](https://www.last.fm/api/account/create)
|
||||
|
||||
The Callback URL is actually specified by multi-scrobbler but to keep things consistent you should use
|
||||
```
|
||||
http://localhost:9078/lastfm/callback
|
||||
```
|
||||
or replace `localhost:9078` with your own base URL.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="LastfmClientConfig" fileContent={JsonConfig} client name="lastfm">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|-----------------------------------------|-------------------------------------------------------------------------------|
|
||||
| `LASTFM_API_KEY` | Yes | | Api Key from your API Account |
|
||||
| `LASTFM_SECRET` | Yes | | Shared secret from your API Account |
|
||||
| `LASTFM_REDIRECT_URI` | No | `http://localhost:9078/lastfm/callback` | Url to use for authentication. Must include `lastfm/callback` somewhere in it |
|
||||
| `LASTFM_SESSION` | No | | Session id. Will be generated by authentication flow if not provided. |
|
||||
</Config>
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: Listenbrainz
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/listenbrainz.json.example';
|
||||
|
||||
:::tip[Other Users]
|
||||
|
||||
* To monitor and re-scrobble activity from a Listenbrainz account create a [Listenbrainz (Source)](/configuration/sources/listenbrainz-source)
|
||||
* To accept scrobbles from outside applications as if multi-scrobbler was a Listenbrainz server, create a [Listenbrainz (Endpoint)](/configuration/sources/listenbrainz-endpoint)
|
||||
|
||||
:::
|
||||
|
||||
You will need to run your own Listenbrainz server or have an account [on the official instance](https://listenbrainz.org/login/)
|
||||
|
||||
On your [profile page](https://listenbrainz.org/profile/) find your **User Token** to use in the configuration.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="ListenbrainzClientConfig" fileContent={JsonConfig} client name="listenbrainz">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|-------------------------------|---------------------------------|
|
||||
| LZ_TOKEN | Yes | | User token from your LZ profile |
|
||||
| LZ_USER | Yes | | Your LZ username |
|
||||
| LZ_URL | No | https://api.listenbrainz.org/ | The base URL for the LZ server |
|
||||
</Config>
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: Maloja
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/maloja.json.example';
|
||||
|
||||
Setup a [Maloja server](https://github.com/krateng/maloja?tab=readme-ov-file#how-to-install) if you have not already done this.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Maloja Setup Intructions</summary>
|
||||
|
||||
Using Maloja's example `docker-compose.yml`:
|
||||
|
||||
```yaml reference title="~/malojaData/docker-compose.yml"
|
||||
https://github.com/krateng/maloja/blob/master/example-compose.yml
|
||||
```
|
||||
|
||||
Uncomment `environment` and add `MALOJA_FORCE_PASSWORD=CHANGE_ME` to set an admin password
|
||||
|
||||
Start the container:
|
||||
|
||||
```shell title="~/malojaData"
|
||||
docker compose up -d
|
||||
```
|
||||
</details>
|
||||
|
||||
* Navigate to the Admin Panel (Cog in upper-right corner) -> API Keys (or at http://myMalojaServerIP/admin_apikeys)
|
||||
* Create a **New Key** and then copy the generated key value
|
||||
|
||||
Finally, add the Maloja server URL and API Key to the configuration type you choose to use, below.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MalojaClientConfig" fileContent={JsonConfig} client name="maloja">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|---------|-------------------------------|
|
||||
| `MALOJA_URL` | Yes | | Base URL of your installation |
|
||||
| `MALOJA_API_KEY` | Yes | | Api Key |
|
||||
</Config>
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: Rocksky
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Bluesky from "@site/src/components/snippets/_bluesky.mdx";
|
||||
import JsonConfig from '!!raw-loader!@site/../config/rocksky.json.example';
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
To monitor and re-scrobble activity **from** Rocksky create a [Rocksky (Source)](/configuration/sources/rocksky-source)
|
||||
|
||||
:::
|
||||
|
||||
[**Rocksky**](https://docs.rocksky.app/) is music tracking and discovery platform built on the AT Protocol (Bluesky).
|
||||
|
||||
<details>
|
||||
|
||||
<summary>How does that work?</summary>
|
||||
|
||||
<Bluesky name="Rocksky" lexicon="app.rocksky"/>
|
||||
|
||||
</details>
|
||||
|
||||
:::warning
|
||||
|
||||
The default Bluesky PDS is **public**, meaning your scrobbles are also public (read-only). This isn't any different than using Last.fm or Listenbrainz, in terms of privacy.
|
||||
|
||||
:::
|
||||
|
||||
## Setup
|
||||
|
||||
You will need a [Bluesky](https://bsky.app/) account to use Rocksky.
|
||||
|
||||
:::note
|
||||
|
||||
Usage is adapted from [Rocksky docs](https://docs.rocksky.app/migrating-to-rocksky-scrobble-api-957839m0) on [docs.rocksky.app](https://docs.rocksky.app)
|
||||
|
||||
:::
|
||||
|
||||
* Navigate to [rocksky.app](https://rocksky.app/) and sign up/logn using your Bluesky account
|
||||
* Then, navigate to the [RockSky developer dashboard](https://rocksky.app/apikeys) and obtain an API Key
|
||||
|
||||
## Configuration
|
||||
|
||||
### Handle
|
||||
|
||||
The handle used with multi-scrobbler should be your **full** ATProto handle, including TLD.
|
||||
|
||||
* For regular Bluesky account this will be like: `alice.bsky.social`
|
||||
* For Bluesky accounts that [use their website as their account](https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial) this is your domain: `mydomain.com`
|
||||
* For non-Bluesky users, you probably already know your handle
|
||||
|
||||
If you do not include a TLD then multi-scrobbler will automatically append `.bsky.social` to your handle value.
|
||||
|
||||
<Config config="RockskyClientConfig" fileContent={JsonConfig} client name="rocksky">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | --------- | ------- | ----------------------------------------------------------------------------------- |
|
||||
| ROCKSKY_HANDLE | Yes | | Your **full** ATProto handle. For Bluesky account this is like `myUser.bsky.social` |
|
||||
| ROCKSKY_KEY | Yes | | API Key obtained from Rocksky developer dashboard |
|
||||
</Config>
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: Teal.fm
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/tealfm.json.example';
|
||||
import Bluesky from "@site/src/components/snippets/_bluesky.mdx";
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
To monitor and re-scrobble activity from a ATProto Profile create a [teal.fm (Source)](/configuration/sources/tealfm-source)
|
||||
|
||||
:::
|
||||
|
||||
[**teal.fm**](https://teal.fm/) is a social discovery and web viewing service for scrobbles stored/available on the ATProto network/your repository in a [PDS (Personal Data Server)](https://github.com/Bluesky-social/pds).
|
||||
|
||||
<details>
|
||||
|
||||
<summary>How does that work?</summary>
|
||||
|
||||
<Bluesky name="teal.fm" lexicon="fm.teal"/>
|
||||
|
||||
</details>
|
||||
|
||||
:::warning
|
||||
|
||||
The default Bluesky PDS is **public**, meaning your scrobbles are also public (read-only). This isn't any different than using Last.fm or Listenbrainz, in terms of privacy.
|
||||
|
||||
:::
|
||||
|
||||
:::note
|
||||
|
||||
[teal.fm is still in developement](https://notes.teal.fm/3lzlwe6puis2l) and does not have a public website, yet.
|
||||
|
||||
To view your teal.fm scrobbles you can:
|
||||
|
||||
* use [wrapped.baileytownsend.dev](https://wrapped.baileytownsend.dev/) which gives a simple stats overview of your scrobbles
|
||||
* use [atproto.at](https://atproto.at) to view the raw data (convenience URLs are generated in multi-scrobbler for you to do this)
|
||||
|
||||
:::
|
||||
|
||||
## Setup
|
||||
|
||||
#### Bluesky
|
||||
|
||||
* Create a [Bluesky](https://bsky.app) account, if you don't already have one
|
||||
* Navigate to https://bsky.app/settings/app-passwords
|
||||
* Settings -> Privacy and Security -> App passwords
|
||||
* Create a new **App Password** and save it somewhere, it will not be shown again
|
||||
|
||||
## Configuration
|
||||
|
||||
### Handle
|
||||
|
||||
The handle used with multi-scrobbler should be your **full** ATProto handle, including TLD.
|
||||
|
||||
* For regular Bluesky account this will be like: `alice.bsky.social`
|
||||
* For Bluesky accounts that [use their website as their account](https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial) this is your domain: `mydomain.com`
|
||||
* For non-Bluesky users, you probably already know your handle
|
||||
|
||||
If you do not include a TLD then multi-scrobbler will automatically append `.bsky.social` to your handle value.
|
||||
|
||||
<Config config="TealClientConfig" fileContent={JsonConfig} client name="tealfm">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | --------- | ------- | ----------------------------------------------------------------------------------- |
|
||||
| TEALFM_IDENTIFIER | Yes | | Your **full** ATProto handle. For Bluesky account this is like `myUser.bsky.social` |
|
||||
| TEALFM_APP_PW | Yes | | Bluesky/ATProto network App Password |
|
||||
</Config>
|
||||
File diff suppressed because it is too large
Load Diff
+28
-9
@@ -3,21 +3,22 @@ sidebar_position: 3
|
||||
title: Kitchen Sink
|
||||
---
|
||||
|
||||
# Example Config using all Possible Features
|
||||
# Example Complex Scenario
|
||||
|
||||
Scenario:
|
||||
|
||||
* You want to scrobble plays for yourself (Foxx), Fred, and Mary
|
||||
* Each person has their own Maloja server
|
||||
* Each person has their own [Maloja](/configuration/clients/maloja) server
|
||||
* Each person has their own Spotify account
|
||||
* You have your own Airsonic (subsonic) server you to scrobble from
|
||||
* You have your own Youtube Music account you want to scrobble from
|
||||
* Mary has her own Last.fm account she also wants to scrobble to
|
||||
* Fred has his own Spotify application and provides you with just his access and refresh token because he doesn't trust you (wtf Fred)
|
||||
* You have your own Airsonic ([subsonic](/configuration/sources/subsonic)) server you to scrobble from
|
||||
* You have your own [Youtube Music](/configuration/soures/youtube-mysic) account you want to scrobble from
|
||||
* Mary has her own [Last.fm](/configuration/clients/lastfm) account she also wants to scrobble to
|
||||
* Fred has his own [Spotify](/configuration/sources/spotify) application and provides you with just his access and refresh token because he doesn't trust you (wtf Fred)
|
||||
* Fred has a Plex server and wants to scrobble everything he plays
|
||||
* Mary uses Fred's Plex server but only wants to scrobble her plays from the `podcast` library
|
||||
* The three of you have a shared library on Plex called `party` that you only play when you are hanging out. You want plays from that library to be scrobbled to everyone's servers.
|
||||
* Fred also has his own Jellyfin server and wants to scrobble everything he plays
|
||||
* The three of you have a shared library on [Plex](/configuration/sources/plex) called `party` that you only play when you are hanging out. You want plays from that library to be scrobbled to everyone's servers.
|
||||
* Fred also has his own [Jellyfin server](/configurion/sources/jellyfin) and wants to scrobble everything he plays
|
||||
* You have an android music app that can scrobble to a [custom listenbrainz server](/configuration/sources/listenbrainz-endpoint)
|
||||
|
||||
### All-in-one Config
|
||||
|
||||
@@ -124,6 +125,14 @@ Scenario:
|
||||
"cookie": "__Secure-3PAPISID=3AxsXpy0MKGu75Qb/AkISXGqOnSDn1jEKn; DEVICE_INFO=ChxOekU0Tmpjek5EWTBPRGd3TlRBMk16QXpNdz09EJbS8Z0GGJbS8Z0G; ...",
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "endpointlz",
|
||||
"name": "listenbrainzfoxx",
|
||||
"clients": ["foxxMaloja"],
|
||||
"data": {
|
||||
"token": "myToken"
|
||||
}
|
||||
}
|
||||
],
|
||||
"clients": [
|
||||
{
|
||||
@@ -246,7 +255,6 @@ Scenario:
|
||||
```json5 title="CONFIG_DIR/ytmusic.json"
|
||||
[
|
||||
{
|
||||
"type": "ytmusic",
|
||||
"name": "foxxYoutube",
|
||||
"clients": ["foxxMaloja"],
|
||||
"data": {
|
||||
@@ -255,6 +263,17 @@ Scenario:
|
||||
}
|
||||
]
|
||||
```
|
||||
```json5 title="CONFIG_DIR/endpointlz.json"
|
||||
[
|
||||
{
|
||||
"name": "listenbrainzfoxx",
|
||||
"clients": ["foxxMaloja"],
|
||||
"data": {
|
||||
"token": "myToken",
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```json5 title="CONFIG_DIR/maloja.json"
|
||||
[
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
title: Plex/Tautulli (Deprecated)
|
||||
---
|
||||
|
||||
:::warning[Deprecated]
|
||||
|
||||
Multi-scrobbler >= 0.8.8 supports a Plex Source that [directly uses the API](configuration/configuration.mdx?plexType=api#plex) which removes the need to use Tautulli since it does not require Plex Pass.
|
||||
|
||||
The Tautulli source **and** Plex Webhook source are deprecated and will be removed in an upcoming release. Existing users should migrate to the API source as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
Tracks played on [Plex](https://plex.tv/) can be scrobbled either by:
|
||||
* A [Tautulli](https://tautulli.com/) notification agent with a webhook.
|
||||
* Using Plex [Webhooks](https://support.plex.tv/articles/115002267687-webhooks) (restricted to Plex Pass users)
|
||||
|
||||
# Using Tautulli
|
||||
|
||||
## Create a new Notification Agent
|
||||
|
||||
* Navigate to the **Notification Agents** page in **Settings**
|
||||
* Click **Add a new notification agent**
|
||||
* Select **Webhook**
|
||||
|
||||
## Configure the Agent
|
||||
|
||||
The below sections correspond with the tabs available in the notification agent configuration popup.
|
||||
|
||||
### Configuration
|
||||
* Webhook URL -- `http://localhost:9078/tautulli` (substitute your domain if different than the default)
|
||||
* Webhook Method -- POST
|
||||
|
||||
### Triggers
|
||||
|
||||
Select **Watched**
|
||||
|
||||
### Conditions
|
||||
|
||||
Refer to [Tautulli's documentation](https://github.com/Tautulli/Tautulli-Wiki/wiki/Custom-Notification-Conditions) if you need help here. It may be a good idea to restrict notifications to only one library (if you have a Music library, for instance)
|
||||
|
||||
**This app will only scrobble an item if `media_type` is a "track", which is the default for all music.**
|
||||
|
||||
### Data
|
||||
|
||||
Expand the **Watched** dropdown and add the following code block to the **JSON Data** text field:
|
||||
|
||||
```
|
||||
{
|
||||
"artist_name": "{artist_name}",
|
||||
"track_name": "{track_name}",
|
||||
"track_artist": "{track_artist}",
|
||||
"album_name": "{album_name}",
|
||||
"media_type": "{media_type}",
|
||||
"title": "{title}",
|
||||
"duration": "{duration_sec}",
|
||||
"username": "{username}",
|
||||
"server": "{server_name}",
|
||||
"version": "{server_version}",
|
||||
"library": "{library_name}",
|
||||
"player": "{player}",
|
||||
"device": "{device}",
|
||||
"platform": "{platform}",
|
||||
"action": "{action}",
|
||||
"machine_id": "{machine_id}",
|
||||
"session_key": "{session_key}"
|
||||
}
|
||||
```
|
||||
|
||||
**Click the Save button to finish.**
|
||||
|
||||
Your agent is now configured and ready to scrobble.
|
||||
|
||||
# Using Plex Webhooks
|
||||
|
||||
* Navigate to your **Account/Settings** and find the **Webhooks** page
|
||||
* Click **Add Webhook**
|
||||
* URL -- `http://localhost:9078/plex` (substitute your domain if different than the default)
|
||||
* **Save Changes**
|
||||
|
||||
Plex is now configured to scrobble.
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "Scrobble Sources",
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "configuration/sources/sources"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
title: Azuracast
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import AzuracastConfig from '!!raw-loader!@site/../config/azuracast.json.example';
|
||||
import ShouldScrobble from "@site/src/components/snippets/_should-scrobble.mdx"
|
||||
|
||||
:::tip[Scrobbling Threshold]
|
||||
|
||||
Azuracast may not correctly report track length or position. If this is the case you should reduce the "listened to" **duration** using [Scrobble Thresholds](/configuration/sources#scrobble-thresholds) so that multi-scrobbler scrobbles correctly.
|
||||
|
||||
:::
|
||||
|
||||
The Azuracast server should have **Use High-Performance Now Playing Updates** enabled in _Administration -> System Settings_
|
||||
|
||||
#### URL
|
||||
|
||||
The URL used by MS to connect to Azuracast has the syntax:
|
||||
|
||||
```
|
||||
[ws|wss]://HOST:[PORT]
|
||||
```
|
||||
|
||||
MS will automatically add the path required for websockets, [`/api/live/nowplaying/websocket`](https://www.azuracast.com/docs/developers/now-playing-data/#websockets), to your URL if none is provided. If you use a reverse proxy with a path-based URL or otherwise need a custom path to access the websockets path correctly then explicitly provide it. Examples:
|
||||
|
||||
```
|
||||
URL From Config => MS Uses
|
||||
|
||||
'ws://192.168.0.101' => ws://192.168.0.101/api/live/nowplaying/websocket
|
||||
'ws://azura.mydomain.com' => ws://azura.mydomain.com.com/api/live/nowplaying/websocket
|
||||
'wss://mydomain.com/custom/azura/ws' => wss://mydomain.com/custom/azura/ws
|
||||
```
|
||||
|
||||
#### Scrobble Behavior
|
||||
|
||||
:::info
|
||||
|
||||
<ShouldScrobble filename="azuracast"/>
|
||||
|
||||
:::
|
||||
|
||||
Multi-scrobbler will set the default **scrobbling behavior** based on if either of these settings is configured:
|
||||
|
||||
* live status (`AZURA_LIVE` or `monitorWhenLive`) or
|
||||
* listener count (`AZURA_LISTENERS_NUM` or `monitorWhenListeners`)
|
||||
|
||||
If either is configured then MS will automatically scrobble based on when these conditions are met.
|
||||
|
||||
If neither is configured automatic scrobble defaults to **off** and you should either manually initiate it or explicitly set the default behavior.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | :-------- | :------ | ---------------------------------------------------------------------------------------------- |
|
||||
| `AZ_URL` | Yes | | Azuracast URL *without station name* |
|
||||
| `AZ_STATION` | Yes | | The station name shown on the public page |
|
||||
| `AZURA_LIVE` | No | Yes | Only scrobble when station status is ONLINE |
|
||||
| `AZURA_LISTENERS_NUM` | No | `true` | Only scrobble if station has any listeners (`true`) or listeners are equal-to/greater-than `X` |
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
|
||||
<CodeBlock title="CONFIG_DIR/azuracast.json" language="json5">{AzuracastConfig}</CodeBlock>
|
||||
|
||||
|
||||
or <SchemaLink lower objectName="AzuracastSourceConfig"/>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
|
||||
<AIOExample data={AzuracastConfig} name="azuracast"/>
|
||||
|
||||
|
||||
or <SchemaLink lower objectName="AzuracastSourceConfig"/>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
---
|
||||
title: Deezer
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import DeezerConfig from '!!raw-loader!@site/../config/deezer.json.example';
|
||||
import DeezerDeprecatedConfig from '!!raw-loader!@site/../config/deezer-deprecated.json.example';
|
||||
|
||||
<Tabs groupId="deezerSource" queryString>
|
||||
<TabItem value="arl" label="Unofficial ARL">
|
||||
:::warning
|
||||
|
||||
This Source uses unofficial methods to access Deezer data that are likely in violation of Deezer's TOS. Deezer may change or remove these methods at any time, breaking functionality. Use this Source at your own risk.
|
||||
|
||||
:::
|
||||
|
||||
:::info
|
||||
|
||||
This Source will work only if you have a **Premium** Deezer account.
|
||||
|
||||
:::
|
||||
|
||||
### Retrieve ARL
|
||||
|
||||
The `arl` is a browser cookie that Deezer uses to store your login information. Multi-scrobbler uses the `arl` value to make authorized requests to Deezer's API where it can retrieve listening history.
|
||||
|
||||
**After logging into Deezer**, use one of the methods below to retrieve the `arl` cookie value:
|
||||
|
||||
<Tabs groupId="arlRetrival">
|
||||
<TabItem value="chrome" label="Chrome">
|
||||
1. On deezer.com, press F12 to open the Developer Tools window.
|
||||
2. Go to the Applications tab. Press the '>>' More tabs icon if it's hidden.
|
||||
3. Under the Cookies Filter, click deezer.com, then the text bar name `arl`.
|
||||
4. Copy all the contents shown in the **Cookie Value** pane.
|
||||
</TabItem>
|
||||
<TabItem value="firefox" label="Firefox">
|
||||
1. On deezer.com, hit Ctrl+Shift+I to open Developer Tools
|
||||
2. Go to the Storage Tab, then expand Cookies in the sidebar and select deezer.com
|
||||
3. Find the row with `arl` as the name, then double click the Value column and right click -> copy the value
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | --------- | ------- | ------------------------------------------------ |
|
||||
| `DEEZER_ARL` | Yes | | The ARL cookie value retrieved from your browser |
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
|
||||
<CodeBlock title="CONFIG_DIR/deezer.json" language="json5">{DeezerConfig}</CodeBlock>
|
||||
|
||||
or <SchemaLink lower objectName="DeezerSourceConfig"/>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
|
||||
<AIOExample data={DeezerConfig} name="deezer"/>
|
||||
|
||||
or <SchemaLink lower objectName="DeezerSourceConfig"/>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Duplicate detection
|
||||
|
||||
Third party integrations with Deezer (Sonos) may cause Deezer to [report the same track many times in listening history.](https://github.com/FoxxMD/multi-scrobbler/pull/296#issuecomment-2922374738) If you experience this issue modify your Deezer Source config (file-based only) to include the option `"fuzzyDiscoveryIgnore": "aggressive"`
|
||||
|
||||
<details>
|
||||
|
||||
<summary>deezer.json example</summary>
|
||||
|
||||
```json title="deezer.json"
|
||||
[
|
||||
{
|
||||
"name": "MyDeezer",
|
||||
"data": {
|
||||
"arl": "UOsRPjT3U5Dhaaup3x...",
|
||||
},
|
||||
"options": {
|
||||
"fuzzyDiscoveryIgnore": "aggressive"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</details>
|
||||
|
||||
This option comes with some trade-offs: MS will aggressively detect repeated tracks within a window of time that should eliminate all duplicates. However, this will also prevent *intentionally* repeated tracks from being scrobbled. See [this thread](https://github.com/FoxxMD/multi-scrobbler/pull/296#issuecomment-2970417070) for more information on how this works.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="official" label="Official API">
|
||||
|
||||
:::warning
|
||||
|
||||
**This Source is DEPRECATED because Deezer has dropped official API support.** This Source will **not** be removed but no further support or fixes will be given. [See this issue for more discussion.](https://github.com/FoxxMD/multi-scrobbler/issues/175#issuecomment-2296776625)
|
||||
|
||||
Users cannot create new applications on Deezer Developers and there is no guarantee existing applications will continue to work.
|
||||
|
||||
As a workaround consider:
|
||||
|
||||
* Using the alternative [Deezer Source that uses unofficial, internal API via ARL](./?deezerSource=arl)
|
||||
* Connect Deezer with Last.fm and then use [Last.fm as a Source](/configuration/sources/lastfm-source)
|
||||
|
||||
:::
|
||||
|
||||
Create a new application at [Deezer Developers](https://developers.deezer.com/myapps)
|
||||
|
||||
* Application Domain must be the same as your multi-scrobbler domain. Default is `localhost:9078`
|
||||
* Redirect URL must end in `deezer/callback`
|
||||
* Default would be `http://localhost:9078/deezer/callback`
|
||||
|
||||
After application creation you should have credentials displayed in the "My Apps" dashboard. You will need:
|
||||
|
||||
* **Application ID**
|
||||
* **Secret Key**
|
||||
* **Redirect URL** (if not the default)
|
||||
|
||||
**If no access token is provided...**
|
||||
|
||||
After starting multi-scrobbler with credentials in-place open the dashboard (`http://localhost:9078`) and find your Deezer source. Click **(Re)authenticate and (re)start polling** to start the login process. After login is complete polling will begin automatically.
|
||||
|
||||
###### Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|-----------------------------------------|-----------------------------------|
|
||||
| `DEEZER_CLIENT_ID` | Yes | | Your **Application ID** |
|
||||
| `DEEZER_CLIENT_SECRET` | Yes | | Your **Secret Key** |
|
||||
| `DEEZER_REDIRECT_URI` | No | `http://localhost:9078/deezer/callback` | URI must end in `deezer/callback` |
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
|
||||
<CodeBlock title="CONFIG_DIR/deezer.json" language="json5">{DeezerDeprecatedConfig}</CodeBlock>
|
||||
|
||||
|
||||
or <SchemaLink lower objectName="DeezerSourceConfig"/>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
|
||||
<AIOExample data={DeezerDeprecatedConfig} name="deezer"/>
|
||||
|
||||
|
||||
or <SchemaLink lower objectName="DeezerSourceConfig"/>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,184 @@
|
||||
---
|
||||
title: Google Cast (Chromecast)
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import ChromecastConfig from '!!raw-loader!@site/../config/chromecast.json.example';
|
||||
|
||||
If your media device can be **Cast** to using this button  on your phone/computer then multi-scrobbler can monitor it in order to scrobble music you play.
|
||||
|
||||
|
||||
:::note
|
||||
|
||||
Google Cast support is **experimental**. You may experience crashes and errors while using this Source. Please open an issue if you experience problems and include all information detailed in the issue template to help debug your issue.
|
||||
|
||||
:::
|
||||
|
||||
:::note
|
||||
|
||||
This source relies on common, **basic** music data provided by the cast device which will always be less exhaustive than data parsed from full source integrations. If there is an existing [Source](/configuration/sources) it is recommended to configure for it and blacklist the app on Google Cast, rather than relying solely on Google Cast for scrobbling.
|
||||
|
||||
:::
|
||||
|
||||
#### Connecting Devices
|
||||
|
||||
Cast devices can be manually configured using file-based configuration OR automatically discovered using **mDNS.**
|
||||
|
||||
###### mDNS Discovery
|
||||
|
||||
The host machine running multi-scrobbler must be configured to allow [mDNS traffic on port 5353/UDP](https://book.hacktricks.xyz/network-services-pentesting/5353-udp-multicast-dns-mdns).
|
||||
|
||||
<details>
|
||||
|
||||
<summary>OS Specific Instructions</summary>
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="linux" label="Linux">
|
||||
**Docker**
|
||||
|
||||
The host machine must have [avahi-daemon](https://avahi.org/) running to circumvent limitations with DNS resolution due to musl in Alpine. Most major linux distributions package avahi and many have it built-in. Once avahi is running you must pass D-Bus and the avahi daemon socket to your container like so:
|
||||
|
||||
```
|
||||
docker run ... -v /var/run/dbus:/var/run/dbus -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket ... foxxmd/multi-scrobbler
|
||||
```
|
||||
|
||||
**Flatpak/Nodejs**
|
||||
|
||||
No additional steps are required.
|
||||
</TabItem>
|
||||
<TabItem value="windows" label="Windows">
|
||||
**Docker**
|
||||
|
||||
Unsupported at this time.
|
||||
|
||||
**Nodejs**
|
||||
|
||||
No additional steps are required.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
</details>
|
||||
|
||||
#### What Media Does MS Scrobble?
|
||||
|
||||
Cast devices report what type of media the current activity is [(see `metadata` property here)](https://developers.google.com/cast/docs/media/messages#MediaInformation). The reported type is dependent on the application playing the media to correctly report it, the cast device does not magically know what the media is. If an application does not report a type it is always classified as `unknown`.
|
||||
|
||||
**By default, MS will only track media that is reported as `MusicTrack`.**
|
||||
|
||||
##### Allow Unknown Media Type
|
||||
|
||||
Media with an Unknown (`Generic`) media type can be explicitly allowed by setting `"allowUnknownMedia": true` in the file-based configuration. This can also be configured to only allow unknown media types for specific applications by using a list of application names.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
```json5 title="chromecast.json"
|
||||
[
|
||||
{
|
||||
"name": "MyCast",
|
||||
"type": "chromecast",
|
||||
"data": {
|
||||
// only allow unknown if app name contains any of these phrases
|
||||
"allowUnknownMedia": ["smarttube", "default media receiver"]
|
||||
},
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
##### Forcing Media Tracking
|
||||
|
||||
MS can be forced to track media from an application regardless of media type. This is useful if an application incorrectly reports a media type you are sure should be music. Set `"forceMediaRecognitionOn"` in the file-based configuration to a list of application names that should always be tracked.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
```json5 title="chromecast.json"
|
||||
[
|
||||
{
|
||||
"name": "MyCast",
|
||||
"type": "chromecast",
|
||||
"data": {
|
||||
// media from applications that contains these phrases will always be tracked, regardless of media type reported
|
||||
"forceMediaRecognitionOn": ["smarttube", "default media receiver"]
|
||||
},
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
#### Cast Troubleshooting
|
||||
|
||||
Please include any/all logs with raw output if there are any errors encountered as this is critical to diagnosing issues.
|
||||
|
||||
To diagnose bad/incomplete track information or strange MS player behavior please turn on **payload logging** and include log output of the source running to help diagnose this issue. Either enable in config using the below example OR enable [Debug Mode.](/configuration#debug-mode)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
```json5 title="chromecast.json"
|
||||
[
|
||||
{
|
||||
"name": "MyCast",
|
||||
"type": "chromecast",
|
||||
"data": {
|
||||
//...
|
||||
},
|
||||
"options": {
|
||||
"logPayload": true
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
:::note
|
||||
[Manually configuring cast device connections](#connecting-devices) is only available through file-based config.
|
||||
:::
|
||||
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|---------|--------------------------------------------------------------------------------------|
|
||||
| CC_ENABLE | No | | Set to 'true' to enable Cast monitoring without needing to define other ENVs |
|
||||
| CC_WHITELIST_DEVICES | No | | Only scrobble from these Cast devices. Comma-delimited list. EX mini-home, family-tv |
|
||||
| CC_BLACKLIST_DEVICES | No | | Do not scrobble from these Cast devices. Comma-delimited list |
|
||||
| CC_WHITELIST_APPS | No | | Only scrobble from these casted Apps. Comma-delimited list. EX spotify, pandora |
|
||||
| CC_BLACKLIST_APPS | No | | Do not scrobble from these casted Apps. Comma-delimited list |
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
<CodeBlock title="CONFIG_DIR/chromecast.json" language="json5">{ChromecastConfig}</CodeBlock>
|
||||
|
||||
</details>
|
||||
|
||||
or <SchemaLink lower objectName="ChromecastSourceConfig"/>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
<AIOExample data={ChromecastConfig} name="chromecast"/>
|
||||
|
||||
</details>
|
||||
|
||||
or <SchemaLink lower objectName="ChromecastSourceConfig"/>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,97 @@
|
||||
---
|
||||
title: Icecast
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import IcecastConfig from '!!raw-loader!@site/../config/icecast.json.example';
|
||||
import ShouldScrobble from "@site/src/components/snippets/_should-scrobble.mdx"
|
||||
|
||||
Parse metadata from any Icecast Station (streams) to use for scrobbling.
|
||||
|
||||
:::note
|
||||
|
||||
There is no standard format for presenting track information in an Icecast stream and the majority of streams that do include metadata only use a single string (`StreamTitle`) from which metadata can be parsed.
|
||||
|
||||
Multi-scrobbler will do its best to parse Artist/Album/Track information from this data but the quality and consistency for this is solely based on how the Icecast broadcaster chooses to format their tracks.
|
||||
|
||||
:::
|
||||
|
||||
:::note[Scrobbling Behavior]
|
||||
|
||||
Multi-scrobbler cannot automatically determine if you are listening to a Station. Therefore, **automatic scrobbling for Icecast Sources is off by default.**
|
||||
|
||||
Use [Should Scrobble Behavior](/configuration/sources#should-scrobble-behavior) to initiate scrobbling or configure automatic scrobble.
|
||||
|
||||
:::
|
||||
|
||||
:::tip[Scrobbling Threshold]
|
||||
|
||||
Icecast does not report track lengths so multi-scrobbler cannot determine if it should scrobble based on percent played. You should instead set a shorter "listened to" **duration** using [Scrobble Thresholds.](/configuration/sources#scrobble-thresholds)
|
||||
|
||||
:::
|
||||
|
||||
|
||||
#### URL and Sources
|
||||
|
||||
The URL should be the URL you would use to stream audio.
|
||||
|
||||
Additional sources are supported based on those found in [`icecast-metadata-stats`](https://github.com/eshaz/icecast-metadata-js/tree/main/src/icecast-metadata-stats#supported-status-apis). To use these with automatic parsing [based on the regular URL](https://github.com/eshaz/icecast-metadata-js/tree/main/src/icecast-metadata-stats#options) include a `sources` array in your config the same way as shown in `icecast-metadata-stats`:
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
```json5 title="config.json"
|
||||
[
|
||||
{
|
||||
"name": "myIcy",
|
||||
"enable": true,
|
||||
"data": {
|
||||
"url": "http://myIcecast.com/radio",
|
||||
"sources": ["icy", "ogg", "sevenhtml"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
```
|
||||
</details>
|
||||
|
||||
To manually set these sources include the same [`*Endpoint` options](https://github.com/eshaz/icecast-metadata-js/tree/main/src/icecast-metadata-stats#options) found in `icecast-metadata-stats`.
|
||||
|
||||
If no `sources` are configured for multi-scrobbler it will automatically try to use `icy` and `ogg`.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | :-------- | :------ | ----------- |
|
||||
| `ICECAST_URL` | Yes | | Icecast URL |
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
<CodeBlock title="CONFIG_DIR/icecast.json" language="json5">{IcecastConfig}</CodeBlock>
|
||||
|
||||
</details>
|
||||
|
||||
or <SchemaLink lower objectName="IcecastSourceConfig"/>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
<AIOExample data={IcecastConfig} name="icecast"/>
|
||||
|
||||
</details>
|
||||
|
||||
or <SchemaLink lower objectName="IcecastSourceConfig"/>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: Jellyfin
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JellyfinConfig from '!!raw-loader!@site/../config/jellyfin.json.example';
|
||||
|
||||
Must be using Jellyfin 10.7 or greater
|
||||
|
||||
* Create an **API Key** for multi-scrobbler
|
||||
* In the Jellyfin desktop web UI Navigate to -> Administration -> Dashboard -> API Keys (`http://YOUR_JELLYIN_URL/web/index.html#!/apikeys.html`)
|
||||
* Click `+` button and create a new key with **App name** `multi-scrobbler`
|
||||
* Copy the created API Key value for use in configuration below
|
||||
|
||||
|
||||
It is **recommended** to use API Key + username but if you are not an admin for your Jellyfin instance you can also authenticate with your Jellyfin username and **password.**
|
||||
|
||||
:::tip[Important Defaults]
|
||||
|
||||
By default...
|
||||
|
||||
* multi-scrobbler will **only** scrobble for the user authenticated with the API.
|
||||
* Allowed Users (`usersAllow` or `JELLYFIN_USERS_ALLOW`) are only necessary if you want to scrobble for additional users.
|
||||
* multi-scrobbler will **only** scrobble media found in Jellyfin libraries that were labelled as **Music.**
|
||||
* `librariesAllow` or `JELLYFIN_LIBRARIES_ALLOW` will override this
|
||||
* OR use `additionalAllowedLibraryTypes` to allow more types (like `mixed` or `book` for audiobooks)
|
||||
* multi-scrobbler will **only** scrobble media Jellyfin detects as **Audio.**
|
||||
* To force multi-scrobbler to scrobble when media is detected as **Unknown** use `"allowUnknown": true` in file/aio configuration.
|
||||
|
||||
:::
|
||||
|
||||
#### Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| -------------------------- | --------- | ------- | ------------------------------------------------------------------------------------------ |
|
||||
| `JELLYFIN_URL` | **Yes** | | The URL of the Jellyfin server IE `http://localhost:8096` |
|
||||
| `JELLYFIN_USER` | **Yes** | | The user to authenticate with the API |
|
||||
| `JELLYFIN_APIKEY` | No | | The API Key to use for authentication **(Must provide either apikey or password)** |
|
||||
| `JELLYFIN_PASSWORD` | No | | The password of the user to authenticate for. **(Must provide either apikey or password)** |
|
||||
| `JELLYFIN_USERS_ALLOW` | No | | Comma-separated list of usernames (from Jellyfin) to scrobble for |
|
||||
| `JELLYFIN_USERS_BLOCK` | No | | Comma-separated list of usernames (from Jellyfin) to disallow scrobble for |
|
||||
| `JELLYFIN_DEVICES_ALLOW` | No | | Comma-separated list of devices to scrobble from |
|
||||
| `JELLYFIN_DEVICES_BLOCK` | No | | Comma-separated list of devices to disallow scrobbles from |
|
||||
| `JELLYFIN_LIBRARIES_ALLOW` | No | | Comma-separated list of libraries to allow scrobbles from |
|
||||
| `JELLYFIN_LIBRARIES_BLOCK` | No | | Comma-separated list of libraries to disallow scrobbles from |
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
|
||||
<CodeBlock title="CONFIG_DIR/jellyfin.json" language="json5">{JellyfinConfig}</CodeBlock>
|
||||
|
||||
or <SchemaLink lower objectName="JellyApiSourceConfig"/>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
|
||||
<AIOExample data={JellyfinConfig} name="jellyfin"/>
|
||||
|
||||
|
||||
or <SchemaLink lower objectName="JellyApiSourceConfig"/>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,76 @@
|
||||
---
|
||||
title: JRiver
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JriverConfig from '!!raw-loader!@site/../config/jriver.json.example';
|
||||
|
||||
In order for multi-scrobbler to communicate with JRiver you must have [Web Server Interface](https://wiki.jriver.com/index.php/Web_Service_Interface#Documentation_of_Functions) enabled. This can can be in the JRiver GUI:
|
||||
|
||||
* Tools -> Options -> Media Network
|
||||
* Check `Use Media Network to share this library...`
|
||||
* If you have `Authentication` checked you will need to provide the **Username** and **Password** in the ENV/File configuration below.
|
||||
|
||||
### URL
|
||||
|
||||
The URL used to connect to JRiver, set in your [file config as `url`.](#configuration) The URL used to connect ultimately must be formed like this:
|
||||
|
||||
```
|
||||
Syntax => [protocol]://[hostname]:[port]/[path]
|
||||
Default => http://localhost:52199/MCWS/v1/
|
||||
```
|
||||
|
||||
If any part of this URL is missing multi-scrobbler will use a default value. This also means that if any part of your URL is **not** standard you must explicitly define it.
|
||||
|
||||
:::tip[Jriver Settings]
|
||||
|
||||
* Make sure the port number matches what is found in `Advanced` section in the Media Network options.
|
||||
* If your installation is on the same machine but you cannot connect using `localhost` try `0.0.0.0` instead.
|
||||
|
||||
:::
|
||||
|
||||
<details>
|
||||
<summary>URL Transform Examples</summary>
|
||||
|
||||
Examples of a given `url` in your file config and the final URL multi-scrobbler will use to connect to JRiver:
|
||||
|
||||
| `url` | Transformed URL |
|
||||
|------------------------------------------|---------------------------------------------|
|
||||
| (none set) | `http://localhost:52199/MCWS/v1/` |
|
||||
| `jriver.mydomain.com` | `http://jriver.mydomain.com:52199/MCWS/v1/` |
|
||||
| `192.168.0.101:3456` | `http://192.168.0.101:3456/MCWS/v1/` |
|
||||
| `mydomain.com:80/jriverReverse/MCWS/v1/` | `mydomain.com:80/jriverReverse/MCWS/v1/` |
|
||||
|
||||
</details>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
<EnvType>
|
||||
| Environmental Variable | Required | Default | Description |
|
||||
|------------------------|----------|---------------------------------|------------------------------------------------|
|
||||
| JRIVER_URL | Yes | http://localhost:52199/MCWS/v1/ | The URL of the JRiver server |
|
||||
| JRIVER_USERNAME | No | | If authentication is enabled, the username set |
|
||||
| JRIVER_PASSWORD | No | | If authenticated is enabled, the password set |
|
||||
</EnvType>
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
<FileType>
|
||||
<CodeBlock title="CONFIG_DIR/jriver.json" language="json5">{JriverConfig}</CodeBlock>
|
||||
|
||||
or <SchemaLink lower objectName="JRiverSourceConfig"/>
|
||||
</FileType>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
<AIOType>
|
||||
<AIOExample data={JriverConfig} name="jriver"/>
|
||||
|
||||
or <SchemaLink lower objectName="JRiverSourceConfig"/>
|
||||
</AIOType>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: Kodi
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import KodiConfig from '!!raw-loader!@site/../config/kodi.json.example';
|
||||
import Config from '@site/src/components/GenericConfiguration.mdx';
|
||||
|
||||
In order for multi-scrobbler to communicate with Kodi you must have the [Web Interface](https://kodi.wiki/view/Web_interface) enabled. This can be done in the Kodi GUI:
|
||||
|
||||
* Settings -> Services -> Control
|
||||
* Check `Allow remote control via HTTP`
|
||||
* Ensure you have a **Username** and **Password** set, you will need to provide them in the ENV/File configuration below.
|
||||
|
||||
### URL
|
||||
|
||||
The URL used to connect to Kodi, set in your [file config as `url`.](#configuration) The URL used to connect ultimately must be formed like this:
|
||||
|
||||
```
|
||||
Syntax => [protocol]://[hostname]:[port]/[path]
|
||||
Default => http://localhost:8080/jsonrpc
|
||||
```
|
||||
|
||||
If any part of this URL is missing multi-scrobbler will use a default value. This also means that if any part of your URL is **not** standard you must explicitly define it.
|
||||
|
||||
:::tip[Kodi Settings]
|
||||
|
||||
* Make sure the port number matches what is found in **Port** in the Control section mentioned above.
|
||||
* If your installation is on the same machine but you cannot connect using `localhost` try `0.0.0.0` instead.
|
||||
|
||||
:::
|
||||
|
||||
<details>
|
||||
<summary>URL Transform Examples</summary>
|
||||
|
||||
Examples of a given `url` in your file config and the final URL multi-scrobbler will use to connect to Kodi:
|
||||
|
||||
| `url` | Transformed URL |
|
||||
|---------------------------------------|----------------------------------------------|
|
||||
| (none set) | `http://localhost:8080/jsonrpc` |
|
||||
| `kodi.mydomain.com` | `http://kodi.mydomain.com:8080/jsonrpc` |
|
||||
| `192.168.0.101:3456` | `http://192.168.0.101:3456/jsonprc` |
|
||||
| `mydomain.com:80/kodiReverse/jsonrpc` | `http://mydomain.com:80/kodiReverse/jsonrpc` |
|
||||
|
||||
</details>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="KodiSourceConfig" fileContent={KodiConfig} name="kodi">
|
||||
| Environmental Variable | Required | Default | Description |
|
||||
|------------------------|----------|-------------------------------|----------------------------|
|
||||
| KODI_URL | Yes | http://localhost:8080/jsonrpc | The URL of the Kodi server |
|
||||
| KODI_USERNAME | No | | The username set |
|
||||
| KODI_PASSWORD | No | | The password set |
|
||||
</Config>
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: Koito
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import KoitoConfig from '!!raw-loader!@site/../config/koito.json.example';
|
||||
|
||||
This Source monitors a Koito account's scrobble history and then re-scrobbles discovered tracks to configured [Clients.](/configuration/clients)
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
To _scrobble to_ a Koito server, create a [Koito (Client)](/configuration/clients/koito)
|
||||
|
||||
:::
|
||||
|
||||
See the [Koito (Client)](/configuration/clients/koito) configuration for general setup. The only difference for **Source** configuration:
|
||||
|
||||
* Cannot be setup with ENV config
|
||||
* [File/AIO config](/configuration?configType=file#configuration-types) must include `"configureAs": "source"`
|
||||
|
||||
#### Configuration
|
||||
|
||||
<Config config="KoitoSourceConfig" fileContent={KoitoConfig} name="koito">
|
||||
:::note
|
||||
You cannot use ENV variables shown in the [Koito Client config](/configuration/clients/koito) -- multi-scrobbler assumes Koito ENVs are always used for the **client** configuration. You must use the [File or AIO](/configuration?configType=file#configuration-types) config to setup Koito as a Source.
|
||||
:::
|
||||
</Config>
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Lastfm (Endpoint)
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import LastfmEndpointConfig from '!!raw-loader!@site/../config/endpointlfm.json.example';
|
||||
|
||||
This Source enables multi-scrobbler to accept scrobbles from outside applications as if it was a Last.fm server.
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
* To **scrobble to** Last.fm, create a [Last.fm (Client)](/configuration/clients/lastfm)
|
||||
* To monitor and re-scrobble activity from your Last.fm account, create a [Last.fm (Source)](/configuration/sources/lastfm-source)
|
||||
|
||||
:::
|
||||
|
||||
### URL
|
||||
|
||||
If a **slug** is **not** provided in configuration then multi-scrobbler will accept Last.fm scrobbles at
|
||||
|
||||
```
|
||||
http://localhost:9078/2.0/
|
||||
```
|
||||
|
||||
which is the "standard" Last.fm server path for scrobbling
|
||||
|
||||
Use a slug only if you need to setup multiple Last.fm Endpoint sources and cannot use different tokens.
|
||||
|
||||
If a slug is used then the URL will be:
|
||||
|
||||
```
|
||||
http://localhost:9078/api/lastfm/mySlug
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="LastFMEndpointSourceConfig" fileContent={LastfmEndpointConfig} name="endpointlfm">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | :-------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `LFMENDPOINT_ENABLE` | No | | Use LFM Endpoint as a Source without any other configuration. Only required if slug/token are not provided as ENVs |
|
||||
| `LFM_SLUG` | No | | (Optional) The URL suffix to use for accepting LFM scrobbles |
|
||||
</Config>
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: Lastfm
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import LastfmConfig from '!!raw-loader!@site/../config/lastfm.json.example';
|
||||
|
||||
This Source **monitors your Last.fm scrobble history** and re-scrobbles new activity to configured [Clients.](/configuration/clients)
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
* To **scrobble to** Last.fm, create a [Last.fm (Client)](/configuration/clients/lastfm)
|
||||
* To accept scrobbles from outside applications as if multi-scrobbler was Last.fm, create a [Last.fm (Endpoint)](/configuration/sources/lastfm-endpoint)
|
||||
|
||||
:::
|
||||
|
||||
To configure this Source use the same registration instructions and configuration data shown in [Last.fm (Client)](/configuration/clients/lastfm) with the difference being `"configureAs": "source"` defined in the File/AIO configuration below.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="LastfmSourceConfig" fileContent={LastfmConfig} name="lastfm">
|
||||
:::note
|
||||
You cannot use ENV variables shown in the [Last.fm Client config](/configuration/clients/lastfm) -- multi-scrobbler assumes Last.fm ENVs are always used for the **client** configuration. You must use the [File or AIO](/configuration?configType=file#configuration-types) config to setup Last.fm as a Source.
|
||||
:::
|
||||
</Config>
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Listenbrainz (Endpoint)
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import ListenbrainzEndpointConfig from '!!raw-loader!@site/../config/endpointlz.json.example';
|
||||
|
||||
This Source enables multi-scrobbler to accept scrobbles from outside applications as if it was a Listenbrainz server.
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
* To **scrobble to** Listenbrainz, create a [Listenbrainz (Client)](/configuration/clients/listenbrainz)
|
||||
* To monitor and re-scrobble activity from your Listenbrainz account, create a [Listenbrainz (Source)](/configuration/sources/listenbrainz-source)
|
||||
|
||||
:::
|
||||
|
||||
### URL
|
||||
|
||||
If a **slug** is **not** provided in configuration then multi-scrobbler will accept Listenbrainz scrobbles at
|
||||
|
||||
```
|
||||
http://myMultiScrobblerIP:9078/1/submit-listens
|
||||
```
|
||||
|
||||
which is the "standard" Listenbrainz server path for scrobbling.
|
||||
|
||||
In general, you should use `http://myMultiScrobblerIP:9078/1/` as the **base path** when configuring your application to scrobble to multi-scrobbler.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>URL Setup for Popular Apps</summary>
|
||||
|
||||
##### Navidrome
|
||||
|
||||
Set the [**ListenBrainz.BaseURL**](https://www.navidrome.org/docs/usage/configuration-options/#advanced-configuration) (env `ND_LISTENBRAINZ_BASEURL`) to `http://myMultiScrobblerIP:9078/1/`
|
||||
|
||||
</details>
|
||||
|
||||
Use a slug only if you need to setup multiple Listenbrainz Endpoint sources and cannot use different tokens.
|
||||
|
||||
If a slug is used then the URL will be:
|
||||
|
||||
```
|
||||
http://myMultiScrobblerIP:9078/api/listenbrainz/mySlug
|
||||
```
|
||||
|
||||
:::note
|
||||
Some Listenbrainz applications may require custom Listenbrainz URLs to be a real domain (`example.com`) and/or use SSL (`https://`). In this case you should setup multi-scrobbler behind a reverse proxy to support this functionality. It is out of the scope of this project to do this solely within multi-scrobbler.
|
||||
:::
|
||||
|
||||
### Token
|
||||
|
||||
Most Listenbrainz clients require a token (Authentication Token) to be provided during setup. This value can be anything you want, just make sure to use the same value for `token` in your multi-scrobbler configuration for the endpoint.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="ListenbrainzEndpointSourceConfig" fileContent={ListenbrainzEndpointConfig} name="endpointlz">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | :-------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| `LZENDPOINT_ENABLE` | No | | Use LZ Endpoint as a Source without any other configuration. Only required if slug/token are not provided as ENVs |
|
||||
| `LZE_TOKEN` | No | | LZ "Authentication Token" you provided to the scrobbling application |
|
||||
| `LZE_SLUG` | No | | (Optional) The URL suffix to use for accepting LZ scrobbles |
|
||||
</Config>
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: Listenbrainz
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import ListenbrainzConfig from '!!raw-loader!@site/../config/listenbrainz.json.example';
|
||||
|
||||
This Source monitors a Listenbrainz account's scrobble history and then re-scrobbles discovered tracks to configured clients.
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
* To **scrobble to** a Listenbrainz server, create a [Listenbrainz (Client)](/configuration/clients/listenbrainz)
|
||||
* To accept scrobbles from outside applications as if multi-scrobbler was a Listenbrainz server, create a [Listenbrainz (Endpoint)](/configuration/sources/listenbrainz-endpoint)
|
||||
|
||||
:::
|
||||
|
||||
You will need to run your own Listenbrainz server or have an account [on the official instance](https://listenbrainz.org/login/).
|
||||
|
||||
On your [profile page](https://listenbrainz.org/profile/) find your **User Token** to use in the configuration.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="ListenBrainzSourceConfig" fileContent={ListenbrainzConfig} name="listenbrainz">
|
||||
:::note
|
||||
You cannot use ENV variables shown in the [Listenbrainz Client config](/configuration/clients/listenbrainz) -- multi-scrobbler assumes Listenbrainz ENVs are always used for the **client** configuration. You must use the [File or AIO](/configuration?configType=file#configuration-types) config to setup Listenbrainz as a Source.
|
||||
:::
|
||||
</Config>
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: Maloja
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import MalojaConfig from '!!raw-loader!@site/../config/maloja.json.example';
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
To _scrobble to_ a Maloja server, create a [Maloja (Client)](/configuration/clients/maloja)
|
||||
|
||||
:::
|
||||
|
||||
See the [Maloja (Client)](/configuration/clients/maloja) configuration for general setup. The only difference for **Source** configuration:
|
||||
|
||||
* Cannot be setup with ENV config
|
||||
* [File/AIO config](/configuration?configType=file#configuration-types) must include `"configureAs": "source"`
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MalojaSourceConfig" fileContent={MalojaConfig} name="maloja">
|
||||
:::note
|
||||
You cannot use ENV variables shown in the [Maloja Client config](/configuration/clients/maloja) -- multi-scrobbler assumes Maloja ENVs are always used for the **client** configuration. You must use the [[File or AIO](/configuration?configType=file#configuration-types) config to setup Maloja as a Source.
|
||||
:::
|
||||
</Config>
|
||||
@@ -0,0 +1,102 @@
|
||||
---
|
||||
title: Mopidy
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import MopidyConfig from '!!raw-loader!@site/../config/mopidy.json.example';
|
||||
|
||||
Mopidy is a headless music server that supports playing music from many [standard and non-standard sources such as Pandora, Bandcamp, and Tunein.](https://mopidy.com/ext/)
|
||||
|
||||
multi-scrobbler can scrobble tracks played from any Mopidy backend source, regardless of where you listen to them.
|
||||
|
||||
:::note
|
||||
|
||||
You must have [Mopidy-HTTP extension](https://mopidy.com/ext/http) enabled for this integration to work.
|
||||
|
||||
:::
|
||||
|
||||
#### URL
|
||||
|
||||
The URL used to connect to the Mopidy server, set in your [file config as `url`.](#configuration) The URL used to connect ultimately must be formed like this:
|
||||
|
||||
```
|
||||
Syntax => [protocol]://[hostname]:[port]/[path]
|
||||
Default => ws://localhost:6680/mopidy/ws
|
||||
```
|
||||
|
||||
If any part of this URL is missing multi-scrobbler will use a default value. This also means that if any part of your URL is **not** standard you must explicitly define it.
|
||||
|
||||
:::tip[Mopidy Configuration]
|
||||
|
||||
Make sure the hostname and port number match what is found in the Mopidy configuration file `mopidy.conf`:
|
||||
|
||||
```ini
|
||||
[http]
|
||||
hostname = localhost
|
||||
port = 6680
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
<details>
|
||||
<summary>URL Transform Examples</summary>
|
||||
|
||||
Examples of a given `url` in your file config and the final URL multi-scrobbler will use to connect to Mopidy:
|
||||
|
||||
| `url` | Transformed URL |
|
||||
|--------------------------------|--------------------------------------------|
|
||||
| (none set) | `ws://localhost:6680/mopidy/ws` |
|
||||
| `mopidy.mydomain.com` | `ws://mopidy.mydomain.com:6680/mopidy/ws/` |
|
||||
| `192.168.0.101:3456` | `ws://192.168.0.101:3456/mopidy/ws/` |
|
||||
| `mopidy.mydomain.com:80/MOPWS` | `ws://mopidy.mydomain.com:80/MOPWS` |
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
### URI Blacklist/Whitelist
|
||||
|
||||
If you wish to disallow or only allow scrobbling from some sources played through Mopidy you can specify these using `uriBlacklist` or `uriWhitelist` in your config. multi-scrobbler will check the list to see if any string matches the START of the `uri` on a track. If whitelist is used then blacklist is ignored. All strings are case-insensitive.
|
||||
|
||||
<details>
|
||||
<summary>Example</summary>
|
||||
```json
|
||||
{
|
||||
"uriBlacklist": ["soundcloud"]
|
||||
}
|
||||
```
|
||||
|
||||
Will prevent multi-scrobbler from scrobbling any Mopidy track that start with a `uri` like `soundcloud:song:MySong-1234`
|
||||
</details>
|
||||
|
||||
|
||||
### Album Blacklist
|
||||
|
||||
For certain sources (Soundcloud) Mopidy does not have all track info (Album) and will instead use "Soundcloud" as the Album name. You can prevent multi-scrobbler from using this bad Album data by adding the fake Album name to this list. Multi-scrobbler will still scrobble the track, just without the bad data. All strings are case-insensitive.
|
||||
|
||||
<details>
|
||||
<summary>Example</summary>
|
||||
```json
|
||||
{
|
||||
"albumBlacklist": ["SoundCloud", "Mixcloud"]
|
||||
}
|
||||
```
|
||||
|
||||
If a track would be scrobbled like
|
||||
```
|
||||
Album: Soundcloud, Track: My Cool Track, Artist: A Cool Artist
|
||||
```
|
||||
then multi-scrobbler will instead scrobble
|
||||
```
|
||||
Track: My Cool Track, Artist: A Cool Artist
|
||||
```
|
||||
</details>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MopidySourceConfig" fileContent={MopidyConfig} name="mopidy">
|
||||
No ENV support
|
||||
</Config>
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: MPD (Music Player Daemon)
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import MPDConfig from '!!raw-loader!@site/../config/mpd.json.example';
|
||||
|
||||
MS communicates with MPD using the [TCP client connection.](https://mpd.readthedocs.io/en/stable/user.html#client-connections)
|
||||
|
||||
You should uncomment/create the following settings in your mpd config:
|
||||
|
||||
```
|
||||
bind_to_address "any" # or a specific ipv4/v6 address
|
||||
port "6600"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MPDSourceConfig" fileContent={MPDConfig} name="mpd">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|------------------|-------------|
|
||||
| `MPD_URL` | No | `localhost:6600` | |
|
||||
| `MPD_PASSWORD` | No | | |
|
||||
</Config>
|
||||
@@ -0,0 +1,79 @@
|
||||
---
|
||||
title: MPRIS
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import MPRISConfig from '!!raw-loader!@site/../config/mpris.json.example';
|
||||
|
||||
[MPRIS](https://specifications.freedesktop.org/mpris-spec/latest) is a standard interface for communicating with Music Players on **linux operating systems.**
|
||||
|
||||
If you run Linux and have a notification tray that shows what media you are listening to, you likely have access to MPRIS.
|
||||
|
||||

|
||||
|
||||
multi-scrobbler can listen to this interface and scrobble tracks played by **any media player** that communicates to the operating system with MPRIS.
|
||||
|
||||
##### Host Setup
|
||||
|
||||
MPRIS communication requires multi-scrobbler to have access to the host's dbus-daemon.
|
||||
|
||||
<Tabs groupId="dbus" queryString>
|
||||
<TabItem value="local" label="Local">
|
||||
If multi-scrobbler is running as a [**Local Installation**](../../installation/installation.mdx#nodejs), directly with node/npm, on the same host as MPRIS then no setup is required.
|
||||
|
||||
Remote setup is also possible, see the **Remote Unix Socket** section in the Docker tab.
|
||||
</TabItem>
|
||||
<TabItem value="docker" label="Docker">
|
||||
If multi-scrobbler is running as a [**Docker Container**](../../installation/installation.mdx#docker) some modifications are required...
|
||||
|
||||
##### Local Unix Socket
|
||||
|
||||
The most secure way is to **run a multi-scrobbler container on the same host as MPRIS.** In this scenario you can simply mount the **user session** dbus unix socket into the container. Make sure [`PUID` and `PGID` ENVs are configured](/installation/#linux-host) so the container has permissions to access the socket. Then, modify your compose stack with these additional values:
|
||||
|
||||
```yaml title="docker-compose.yaml"
|
||||
|
||||
environment:
|
||||
- DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/UID/bus
|
||||
|
||||
volumes:
|
||||
- /run/user/UID/bus:/run/user/UID/bus:ro
|
||||
```
|
||||
|
||||
##### Remote Unix Socket
|
||||
|
||||
:::warning
|
||||
|
||||
This method is **insecure.** You should not expose dbus over a network unless access to the port is restricted and the network is trusted.
|
||||
|
||||
:::
|
||||
|
||||
Use [`socat`](https://linux.die.net/man/1/socat) to bidirectionally relay communication from the host's dbus socket to a listening TCP port.
|
||||
|
||||
To make dbus for user with uid `1000` available on port `6644`:
|
||||
|
||||
```shell
|
||||
socat TCP-LISTEN:6644,reuseaddr,fork UNIX-CONNECT:/run/user/1000/bus
|
||||
```
|
||||
|
||||
Then, add the following value to multi-scrobbler's ENVs:
|
||||
|
||||
```
|
||||
DBUS_SESSION_BUS_ADDRESS=tcp:host=yourHostIP,port=6644
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MPRISSourceConfig" fileContent={MPRISConfig} name="mpris">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|---------|----------------------------------------------------------------------------------|
|
||||
| MPRIS_ENABLE | No | | Use MPRIS as a Source (useful when you don't need any other options) |
|
||||
| MPRIS_BLACKLIST | No | | Comma-delimited list of player names not to scrobble from |
|
||||
| MPRIS_WHITELIST | No | | Comma-delimited list of players names to ONLY scrobble from. Overrides blacklist |
|
||||
</Config>
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: Musikcube
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import MusikcubeConfig from '!!raw-loader!@site/../config/musikcube.json.example';
|
||||
|
||||
In order to use [Musikcube](https://musikcube.com) configure it to accept [websocket connections](https://github.com/clangen/musikcube/wiki/remote-api-documentation) in **server setup**:
|
||||
|
||||
* Enable the **Metadata Server**
|
||||
* Set a **Password**
|
||||
|
||||
Both of these settings are found in _Musikcube -> (s)ettings -> server setup_
|
||||
|
||||

|
||||
|
||||
The URL used by MS has the syntax:
|
||||
|
||||
```
|
||||
[ws|wss]://HOST:[PORT]
|
||||
```
|
||||
|
||||
The **port** is the same as shown in the server setup screenshot from above, under **metadata server enabled**. If no port is provided to MS it will default to `7905`.
|
||||
|
||||
If no URL is provided to MS it will try to use `ws://localhost:7905`
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MusikcubeSourceConfig" fileContent={MusikcubeConfig} name="musikcube">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|-----------------------|--------------------------------------|
|
||||
| `MC_URL` | No | `ws://localhost:7905` | Use port set for **metadata server** |
|
||||
| `MC_PASSWORD` | Yes | | |
|
||||
</Config>
|
||||
@@ -0,0 +1,79 @@
|
||||
---
|
||||
title: Plex
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import AzuracastConfig from '!!raw-loader!@site/../config/azuracast.json.example';
|
||||
import PlexConfig from '!!raw-loader!@site/../config/plex.json.example';
|
||||
|
||||
Find your [**Plex Token**](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/) and make note of the **URL** and **Port** used to connect to your Plex instance.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Allowed Users and Defaults</summary>
|
||||
|
||||
**Multi-scrobbler will automatically scrobble for these users by default:**
|
||||
|
||||
* The User authenticated with the Plex Token
|
||||
* and the **Local User**
|
||||
|
||||
The Local User (`PLEX_LOCAL_USER`) is how Plex identifies anyone directly accessing the Plex UI from a local IP (who does not need to login).
|
||||
|
||||
To allow MS to scrobble for other users use `usersAllow` or `PLEX_USERS_ALLOW` (env) from the below configuration docs. However, because you are overriding the default settings you must also explicitly list the authenticated user and the Local User if you want them to also be able to scrobble.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Examples</summary>
|
||||
|
||||
###### Defaults
|
||||
|
||||
If `usersallow` and `PLEX_USERS_ALLOW` are not defined then the Plex Token authenticated User and Local User will be scrobbled for.
|
||||
|
||||
|
||||
###### Only A Specific User
|
||||
|
||||
* `"usersallow": ["SomeUser"]` or
|
||||
* `PLEX_USERS_ALLOW: SomeUser`
|
||||
|
||||
Only the Plex user `SomeUser` will be scrobbled for. The Plex Token authenticated user and the Local User will not be scrobbled for.
|
||||
|
||||
###### A Specific User + Defaults
|
||||
|
||||
(Assuming the plex authenticated user is `FoxxMD`)
|
||||
|
||||
* `"usersallow": ["FoxxMD", "PLEX_LOCAL_USER", "SomeUser"]` or
|
||||
* `PLEX_USERS_ALLOW: FoxxMD,PLEX_LOCAL_USER,SomeUser`
|
||||
|
||||
The Plex user SomeUser, the Plex Token authenticated user (FoxxMD) and the Local User will be scrobbled for.
|
||||
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Allowed Libraries and Defaults</summary>
|
||||
|
||||
By default multi-scrobbler will only scrobble media found in Plex libraries that are labelled as **Music.**
|
||||
* `librariesAllow` or `PLEX_LIBRARIES_ALLOW` will override this
|
||||
|
||||
</details>
|
||||
|
||||
#### Configuration
|
||||
|
||||
<Config config="PlexApiSourceConfig" fileContent={PlexConfig} name="plex">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| ---------------------- | --------- | ------- | ---------------------------------------------------------------------- |
|
||||
| `PLEX_URL` | **Yes** | | The URL of the Plex server IE `http://localhost:32400` |
|
||||
| `PLEX_TOKEN` | **Yes** | | The **Plex Token** to use with the API |
|
||||
| `PLEX_USERS_ALLOW` | No | | Comma-separated list of usernames (from Plex) to scrobble for |
|
||||
| `PLEX_USERS_BLOCK` | No | | Comma-separated list of usernames (from Plex) to disallow scrobble for |
|
||||
| `PLEX_DEVICES_ALLOW` | No | | Comma-separated list of devices to scrobble from |
|
||||
| `PLEX_DEVICES_BLOCK` | No | | Comma-separated list of devices to disallow scrobbles from |
|
||||
| `PLEX_LIBRARIES_ALLOW` | No | | Comma-separated list of libraries to allow scrobbles from |
|
||||
| `PLEX_LIBRARIES_BLOCK` | No | | Comma-separated list of libraries to disallow scrobbles from |
|
||||
</Config>
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Rocksky
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/rocksky.json.example';
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
* To **scrobble to** Rocksky, create a [Rocksky (Client)](/configuration/clients/rocksky)
|
||||
|
||||
:::
|
||||
|
||||
[**Rocksky**](https://docs.rocksky.app/) is music tracking and discovery platform built on the AT Protocol (Bluesky).
|
||||
|
||||
This Source monitors the Rocksky scrobbles in your PDS and then re-scrobbles discovered tracks to configured clients.
|
||||
|
||||
Learn more about how Rocksky scrobbles work in the [Rocksky (Client)](/configuration/clients/rocksky) docs.
|
||||
|
||||
## Setup
|
||||
|
||||
Follow the **Setup** instructions in the [Rocksky (Client)](/configuration/clients/rocksky#setup) docs to get access to your Bluesky PDS repository and scrobble data.
|
||||
|
||||
## Configuration
|
||||
|
||||
See the [Rocksky (Client)](/configuration/clients/rocksky#setup) configuration for general setup. The only difference for **Source** configuration:
|
||||
|
||||
* Cannot be setup with ENV config
|
||||
* [File/AIO config](/configuration?configType=file#configuration-types) must include `"configureAs": "source"`
|
||||
|
||||
<Config config="RockskyClientConfig" fileContent={JsonConfig} name="rocksky">
|
||||
:::note
|
||||
You cannot use ENV variables shown in the [Rocksky Client config](/configuration/clients/rocksky#configuration) -- multi-scrobbler assumes Rocksky ENVs are always used for the **client** configuration. You must use the [File or AIO](/configuration?configType=file#configuration-types) config to setup Rocksky as a Source.
|
||||
:::
|
||||
</Config>
|
||||
@@ -0,0 +1,155 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
title: Overview
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
import ScrobbleThreshold from "@site/src/components/snippets/_scrobble-threshold.mdx"
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
A **Source** is a data source that contains information about tracks you are playing like a music player or platform. Examples are **Spotify, Jellyfin, Plex, Youtube Music, Airsonic**, etc...
|
||||
|
||||
## Sources
|
||||
|
||||
| Name | Networking | Scrobble SOT | [Multi Device/User](#multi-deviceuser) | [Scrobble Destination](#limiting-scrobble-destination) | [Thresholds](#scrobble-thresholds) | [Should Scrobble](#should-scrobble-behavior) |
|
||||
| :---------------------------------------------------------------------- | :------------------------------------------------------- | :-------------------------------------------------- | :------------------------------------- | :----------------------------------------------------- | :--------------------------------- | :------------------------------------------- |
|
||||
| [Azuracast](/configuration/sources/azuracast) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ✅ |
|
||||
| [Deezer](/configuration/sources/deezer) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ✅ | ✅ | ❌ | ❌ |
|
||||
| [Google Cast (Chromecast)](/configuration/sources/google-cast) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ✅ | ✅ | ✅ | ❌ |
|
||||
| [Icecast](/configuration/sources/icecast) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ✅ |
|
||||
| [Jellyfin](/configuration/sources/jellyfin) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ✅ | ✅ | ✅ | ❌ |
|
||||
| [JRiver](/configuration/sources/jriver) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [Kodi](/configuration/sources/kodi) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [Koito](/configuration/sources/koito-source) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [Last.fm](/configuration/sources/lastfm-source) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [Last.fm (Endpoint)](/configuration/sources/lastfm-endpoint) | [Ingress](./?sourceComm=ingress#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [ListenBrainz](/configuration/sources/listenbrainz-source) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [ListenBrainz (Endpoint)](/configuration/sources/listenbrainz-endpoint) | [Ingress](./?sourceComm=ingress#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [Maloja](/configuration/sources/maloja) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [Mopidy](/configuration/sources/mopidy) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [MPD (Music Player Daemon)](/configuration/sources/mpd) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [Musikcube](/configuration/sources/musikcube) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [Plex](/configuration/sources/plex) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ✅ | ✅ | ✅ | ❌ |
|
||||
| [Rocksky](/configuration/sources/rocksky-source) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [Spotify](/configuration/sources/spotify) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ✅ | ✅ | ✅ | ❌ |
|
||||
| [Subsonic-compatible APIs](/configuration/sources/subsonic) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ✅ | ✅ | ✅ | ❌ |
|
||||
| [teal.fm](/configuration/sources/tealfm-source) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [WebScrobbler](/configuration/sources/webscrobbler) | [Ingress](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
| [VLC](/configuration/sources/vlc) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [Yamaha MusicCast](/configuration/sources/yamaha-musiccast) | [Active](./?sourceComm=active#by-communication-method) | [Activity](./?sot=activity#by-data-source-of-truth) | ❌ | ✅ | ✅ | ❌ |
|
||||
| [Youtube Music](/configuration/sources/youtube-music) | [Active](./?sourceComm=active#by-communication-method) | [History](./?sot=history#by-data-source-of-truth) | ❌ | ✅ | ❌ | ❌ |
|
||||
|
||||
## Features
|
||||
|
||||
### Types of Sources
|
||||
|
||||
The Sources implemented in multi-scrobbler can be broken down into two categories.
|
||||
|
||||
#### By Communication Method
|
||||
|
||||
How does this Source get data from the service/application?
|
||||
|
||||
<Tabs groupId="sourceComm" queryString>
|
||||
<TabItem value="active" label="Active">
|
||||
The MS Source makes network requests to the service which returns a response with data MS can use to monitor listening activity or scrobbles.
|
||||
</TabItem>
|
||||
<TabItem value="ingress" label="Ingress">
|
||||
The MS Source waits for the service/application to send data to multi-scrobbler.
|
||||
|
||||
These types of Sources require that multi-scrobbler is accessible to the service, generally through an open port or reverse proxy.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### By Data Source of Truth
|
||||
|
||||
How does MS determine if/when a song has been played and is scrobbable?
|
||||
|
||||
<Tabs groupId="sot" queryString>
|
||||
<TabItem value="activity" label="Listening Activity">
|
||||
These Sources expose some kind of real-time listening data for users, like:
|
||||
|
||||
* player state (paused, stopped, playing)
|
||||
* player position (1:50/2:40)
|
||||
* current listened duration (Track A playing for 1m:20s)
|
||||
|
||||
For theses Sources multi-scrobbler keeps track of the real-time state of your activity and scrobbles a track after it meets certain [scrobble thresholds](#scrobble-thresholds).
|
||||
</TabItem>
|
||||
<TabItem value="history" label="Listening History">
|
||||
Some Sources expose their own version of "this track has been scrobbled."
|
||||
|
||||
* Listenbrainz, Koito, and Last.fm are all scrobble services that have "definitive" histories of scrobbled tracks.
|
||||
|
||||
For these Sources multi-scrobbler monitors the listening history data and scrobbles when it sees a new entry in the list.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Multi-Device/User
|
||||
|
||||
Some Sources report which User is playing a track and/or on what device the track is being played. These Sources can be filtered with configuration to only monitor activity for specific devices or users.
|
||||
|
||||
### Limiting Scrobble Destination
|
||||
|
||||
To limit which Clients a Source will scrobble to use the `clients` property in a Source's [File/AIO configuration](/configuration?configType=file#configuration-types) to specify the **name** property of the Clients that it should scrobble to:
|
||||
|
||||
```json5 title="jellyfin.json"
|
||||
{
|
||||
"name": "MyJellyfin",
|
||||
"clients": ["myMaloja","koitoA","listenbrainzFoo"]
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
If `clients` is empty (`"clients": []`) or is omitted then the default is for the Source to scrobble to **all** configured Clients.
|
||||
|
||||
:::
|
||||
|
||||
:::note
|
||||
|
||||
If a Client is configured using [ENV](/configuration?configType=env#configuration-types) then it is given a generated name. Check the multi-scrobbler Dashboard to find their name in a subheader under the Client type. Example:
|
||||
|
||||

|
||||
|
||||
Otherwise, use the `name` property you gave the client in it's File/AIO config.
|
||||
|
||||
:::
|
||||
|
||||
### Scrobble Thresholds
|
||||
|
||||
<ScrobbleThreshold filename="spotify"/>
|
||||
|
||||
These can also be configured **globally** for all Sources using ENVs:
|
||||
|
||||
```
|
||||
SOURCE_SCROBBLE_DURATION=40
|
||||
SOURCE_SCROBBLE_PERCENT=20
|
||||
```
|
||||
|
||||
### Should Scrobble Behavior
|
||||
|
||||
:::note
|
||||
|
||||
This feature is currently available only for some Sources. Check each Source's documentation to see if it supported.
|
||||
|
||||
:::
|
||||
|
||||
For _most_ Sources multi-scrobbler can determine if a user is listening and scrobble automatically. For Sources which multi-scrobbler cannot do this or require additional configuration, a user can indicate to MS that it should or should not scrobble. This action can be taken on the Web Dashboard by clicking the link next to **Should Scrobble** found in each Source's status card.
|
||||
|
||||
Additionally, for these Sources, the default behavior for Scrobbling can be explicitly set by adding the following value to a Source's `options` in [file or aio config](/configuration?configType=file#configuration-types):
|
||||
|
||||
```json5 title="azuracast.json"
|
||||
{
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
"options": {
|
||||
// set to true to always scrobble automatically
|
||||
// set to false to never scrobble automatically
|
||||
"systemScrobble": true
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
title: Spotify
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import SpotifyConfig from '!!raw-loader!@site/../config/spotify.json.example';
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Spotify and Automix</summary>
|
||||
|
||||
If your Spotify player has [Automix](https://community.spotify.com/t5/FAQs/What-is-Automix/ta-p/5257278) enabled and Spotify uses it for your playlist/queue then MS cannot accurately determine when a track will end. This is because the track is "mixed" in your queue with a shorter play time than its actual length and [Spotify does not report this modified play time in its API.](https://community.spotify.com/t5/Spotify-for-Developers/Wrong-duration-ms-of-track-with-Automix/m-p/5429147) This **does not affect MS's ability to scrobble** from Spotify but it will affect the accuracy of the duration MS reports was played.
|
||||
|
||||
</details>
|
||||
|
||||
#### Authenticate Spotify with Multi-Scrobbler
|
||||
|
||||
To access your Spotify history you must [create a Spotify App](https://developer.spotify.com/dashboard) to get a
|
||||
Client ID/Secret.
|
||||
|
||||
1. **Login to https://developer.spotify.com** with your existing Spotify account and accept Developer Terms
|
||||
|
||||
2. Navigate to your Spotify Developer [Dashboard](https://developer.spotify.com/dashboard) and start the **Create App** process
|
||||
|
||||
3. Determine the correct **Redirect URI** to use and set it in your App settings
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Redirect URI Instructions</summary>
|
||||
|
||||
A Redirect URI is the URL that Spotify will navigate your **browser** to after you complete authorization. The URL will contain the code necessary for multi-scrobbler to get a Spotify access token.
|
||||
|
||||
Spotify [**no longer allows insecure URIs**](https://developer.spotify.com/documentation/web-api/tutorials/migration-insecure-redirect-uri) (start with `http://`) unless the address is `127.0.0.1` -- so `localhost` and internal IPs (`192.168.0.xxx`) no longer work.
|
||||
|
||||
Use **one** of the following methods to specify a valid Redirect URI and complete Spotify authentication with multi-scrobbler:
|
||||
|
||||
<Tabs groupId="spotifyRedirect" queryString>
|
||||
<TabItem value="https" label="HTTPS">
|
||||
**Use a domain you control, with SSL certificates/HTTPS enabled, to create a valid redirect URI.**
|
||||
|
||||
For example, if you are already running multi-scrobbler behind a reverse proxy (nginx/traefik/caddy) at `https://scrobbler.mydomain.com` then set the Spotify Redirect URI for your Spotify App, and multi-scrobbler `SPOTIFY_REDIRECT_URI` ENV, to `https://scrobbler.mydomain.com/callback`
|
||||
|
||||
Alternatively, if multi-scrobbler is not accessible behind your domain, then use the [**Echo**](./?spotifyRedirect=echo) method with your own domain instead of 127.0.0.1.
|
||||
</TabItem>
|
||||
<TabItem value="local" label="Run MS Locally">
|
||||
**Run multi-scrobbler, configured for a Spotify Source, from the same machine as your browser in order to get credentials.**
|
||||
|
||||
In this scenario you can use `http://127.0.0.1:9078/callback` as the Spotify Redirect URI and multi-scrobbler `SPOTIFY_REDIRECT_URI` ENV.
|
||||
|
||||
After completing authentication, copy the contents of local multi-scrobbler's [configuration folder](/installation#storage) to the final location of where multi-scrobbler will be run.
|
||||
</TabItem>
|
||||
<TabItem value="echo" label="Echo">
|
||||
**Use a docker container on the same machine your browser is on to "intercept" the callback URL from Spotify authentication, then manually finish the process by changing the domain to your multi-scrobbler instance.**
|
||||
|
||||
|
||||
1. Create a container on the same machine as your browser using the [`mendhak/http-https-echo:36`](https://github.com/mendhak/docker-http-https-echo) image. This container runs a simple HTTP server that echos back any request it recieves.
|
||||
|
||||
```shell
|
||||
docker run --rm -p 127.0.0.1:5079:8080 mendhak/http-https-echo:36
|
||||
```
|
||||
|
||||
2. Set the Spotify Redirect URI and multi-scrobbler `SPOTIFY_REDIRECT_URI` ENV as `http://127.0.0.1:5079/callback`
|
||||
|
||||
3. In [Authenticate Spotify with Multi-Scrobbler](#authenticate-spotify-with-multi-scrobbler) (outside these Redirect Instructions) go to **Step 4** and continue the instructions
|
||||
|
||||
Eventually, Spotify will redirect you to a web page with a URL like `http://127.0.0.1:5079/callback?code=xxxxxx...`
|
||||
|
||||

|
||||
|
||||
4. In the URL, replace `127.0.0.1:5079` with the address/IP for your multi-scrobbler instance so the URL is similar to `http://192.168.0.101:9078/callback?code=xxxxxx...`. Then navigate to this URL to complete authentication.
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="msEcho" label="Echo from echo.multi-scrobbler.app">
|
||||
For your convenience, I run the [`mendhak/http-https-echo:36`](https://github.com/mendhak/docker-http-https-echo) container from the [**Echo**](./?spotifyRedirect=echo) approach on a domain I, the multi-scrobbler developer [FoxxMD](https://github.com/FoxxMD), control and self-host. Please be aware:
|
||||
|
||||
* I **do not collect personal data** or any querystrings/data sent in requests to this site
|
||||
* It's **not possible** for me to use the code sent by Spotify to this URL without also having your Client ID/Secret
|
||||
* However, there is **always** risk involved with trusting a service you do not control. Evaluate the risk of using this site for yourself.
|
||||
|
||||
Use the [**Echo**](./?spotifyRedirect=echo) approach, starting from **Step 2**, with **https://echo.multi-scrobbler.app/callback** as Spotify Redirect URI and multi-scrobbler `SPOTIFY_REDIRECT_URI` ENV.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
</details>
|
||||
|
||||
4. Save your new App, then copy the Client ID/Secret from the App's Basic Information page.
|
||||
|
||||
5. Add the Client ID, Secret, and Redirect URI to the respective field/ENV in the [configuration section below](#configuration)
|
||||
|
||||
6. Start multi-scrobbler, then visit the Web Dashboard and click **(Re)authenticate** on the Spotify card to start the auth process
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="SpotifySourceConfig" fileContent={SpotifyConfig} name="spotify">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| ----------------------- | --------- | -------------------------------- | -------------------------- |
|
||||
| `SPOTIFY_CLIENT_ID` | Yes | | |
|
||||
| `SPOTIFY_CLIENT_SECRET` | Yes | | |
|
||||
| `SPOTIFY_REDIRECT_URI` | No | `http://localhost:9078/callback` | URI must end in `callback` |
|
||||
</Config>
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Subsonic
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import SubsonicConfig from '!!raw-loader!@site/../config/subsonic.json.example';
|
||||
|
||||
This Source can be used 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/))
|
||||
|
||||
:::warning[Known Issues]
|
||||
|
||||
* Multiple artists are reported as one value and cannot be separated
|
||||
* If using [Airsonic Advanced](https://github.com/airsonic-advanced/airsonic-advanced) the password used (under **Credentials**) must be **Decodable**
|
||||
|
||||
:::
|
||||
|
||||
:::tip
|
||||
|
||||
If your serivce supports scrobbling to **Listenbrainz** (such as Navidrome), considering using a [**Listenbrainz (Endpoint)** Source](/configuration/sources/listenbrainz-endpoint) instead of this one.
|
||||
|
||||
Service-specific scrobble implementations tend to be more accurate and provide more information (multiple artists) compared to the Subsonic API.
|
||||
|
||||
:::
|
||||
|
||||
Use the optional `usersAllow` property with **File** or **AIO** configuration to restrict scrobbling to a list of defined users.
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="SubsonicSourceConfig" fileContent={SubsonicConfig} name="subsonic">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|---------|--------------------------------------|
|
||||
| `SUBSONIC_USER` | Yes | | |
|
||||
| `SUBSONIC_PASSWORD` | Yes | | |
|
||||
| `SUBSONIC_URL` | Yes | | Base url of your subsonic-api server |
|
||||
</Config>
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Teal.fm
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/tealfm.json.example';
|
||||
|
||||
:::tip[Other Uses]
|
||||
|
||||
* To **scrobble to** an ATProto PDS, create a [teal.fm (Client)](/configuration/clients/tealfm)
|
||||
|
||||
:::
|
||||
|
||||
[**teal.fm**](https://teal.fm/) is a social discovery and web viewing service for scrobbles stored/available on the ATProto network/your repository in a [PDS (Personal Data Server)](https://github.com/Bluesky-social/pds).
|
||||
|
||||
This Source monitors the teal.fm scrobbles in your PDS and then re-scrobbles discovered tracks to configured clients.
|
||||
|
||||
Learn more about how teal.fm scrobbles work in the [teal.fm (Client)](/configuration/clients/tealfm) docs.
|
||||
|
||||
## Setup
|
||||
|
||||
Follow the **Setup** instructions in the [teal.fm (Client)](/configuration/clients/tealfm#setup) docs to get access to your Bluesky PDS repository and scrobble data.
|
||||
|
||||
## Configuration
|
||||
|
||||
See the [teal.fm (Client)](/configuration/clients/tealfm#setup) configuration for general setup. The only difference for **Source** configuration:
|
||||
|
||||
* Cannot be setup with ENV config
|
||||
* [File/AIO config](/configuration?configType=file#configuration-types) must include `"configureAs": "source"`
|
||||
|
||||
<Config config="TealClientConfig" fileContent={JsonConfig} name="tealfm">
|
||||
:::note
|
||||
You cannot use ENV variables shown in the [teal.fm Client config](/configuration/clients/tealfm#configuration) -- multi-scrobbler assumes teal.fm ENVs are always used for the **client** configuration. You must use the [File or AIO](/configuration?configType=file#configuration-types) config to setup teal.fm as a Source.
|
||||
:::
|
||||
</Config>
|
||||
@@ -0,0 +1,94 @@
|
||||
---
|
||||
title: VLC
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/vlc.json.example';
|
||||
|
||||
MS communicates with [VLC](https://www.videolan.org/vlc/) using the [Web (`http`) interface module](https://wiki.videolan.org/VLC_HTTP_requests/)
|
||||
|
||||
#### Enable HTTP Interface
|
||||
|
||||
Open VLC:
|
||||
|
||||
* **Tools** Menu -> Preferences
|
||||
* In the bottom left change **Show Settings** from `Simple` to `All`
|
||||
* In the updated window select `Interface -> Main interfaces`
|
||||
* In the **Extra interface modules** section enable **Web** and verify that `http` is shown in the textbox
|
||||
* Select `Interface -> Main interfaces -> Lua`
|
||||
* In Lua HTTP -> Password -> set a password in this box
|
||||
* Click **Save** at the bottom to persist your changes
|
||||
* Restart VLC
|
||||
* Verify the HTTP interface is accessible by navigating to `http://localhost:8080` in your browser
|
||||
|
||||
If the interface is accessible, after typing in your password, VLC is now ready to be used by MS.
|
||||
|
||||
##### Setting VLC Interface and Port
|
||||
|
||||
These can be set by starting VLC from command line with specific options:
|
||||
|
||||
* `vlc --http-host yourHostIp:yourPort` or
|
||||
* `vlc --http-port yourPort` or
|
||||
* modify the configuration file for VLC by editing keys with the same values as from the command line (`http-host` and `http-port`)
|
||||
|
||||
|
||||
#### Filename Parsing
|
||||
|
||||
If the file being played in VLC does not have ID3 tags/metadata information multi-scrobbler can attempt to extract artist, title, and album information from the raw filename using regular expressions. Mutli-scrobbler will only do this if there is **no other information** reported by VLC about these fields.
|
||||
|
||||
To extract this information use [named capture groups](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Named_capturing_group) in your expression matching the field that should be extracted: `artist` `title` and/or `album`. MS accepts multiple expressions, the first one that matches a filename will be used.
|
||||
|
||||
Example usage in [a file-based config:](/configuration?configType=file#configuration-types)
|
||||
|
||||
```json5 title="config/vlc.json" {10-15}
|
||||
[
|
||||
{
|
||||
"name": "MyVlc",
|
||||
"enable": true,
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
"options": {
|
||||
"filenamePatterns": [
|
||||
// Extracts artist and title from filenames that look like:
|
||||
// My Artist - My Cool title.mp4
|
||||
"/^\\s*(?<artist>.+?) - (?<title>.+?)\\.\\w+$/i"
|
||||
],
|
||||
// logs to DEBUG when MS tries to extract data from a filename
|
||||
"logFilenamePatterns": true,
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
#### Vlc Information Reporting
|
||||
|
||||
If you find that VLC is incorrectly reporting track information (in its interface) but multi-scrobbler is not parsing it correctly it may be due to the _name_ of the fields VLC is reporting. mutli-scrobbler uses the most common field name but does not cover all use cases. Before reporting an issue please turn on metadata logging and include output from your logs while it is turned on:
|
||||
|
||||
```json5 title="config/vlc.json" {9-9}
|
||||
[
|
||||
{
|
||||
"name": "MyVlc",
|
||||
"enable": true,
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
"options": {
|
||||
"dumpVlcMetadata": true
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="VLCSourceConfig" fileContent={JsonConfig} name="vlc">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|------------|------------------|-------------|
|
||||
| `VLC_URL` | No | `localhost:8080` | |
|
||||
| `VLC_PASSWORD` | Yes | | |
|
||||
</Config>
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
title: Webscrobbler
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/webscrobbler.json.example';
|
||||
|
||||
After installing the [Webscrobbler extension](https://web-scrobbler.com/) open the preferences/settings for it:
|
||||
|
||||
* Under **Accounts**
|
||||
* **Add Webhook**
|
||||
* API URL: `[YourMultiScrobblerInstance]/api/webscrobbler` EX `http://localhost:9078/api/webscrobbler`
|
||||
* Application name: `(whatever you want)`
|
||||
|
||||
Reload the extension after adding the webhook.
|
||||
|
||||
:::note
|
||||
|
||||
* **On Firefox** - Only FQNs (domain.tld), `localhost`, and `127.0.0.1` are supported for API URL due to [firefox requiring https](https://github.com/web-scrobbler/web-scrobbler/issues/4183#issuecomment-1749222006)
|
||||
* **On Chromium-based Browsers** - Any domain will work for API URL
|
||||
* All other browsers are untested
|
||||
|
||||
:::
|
||||
|
||||
:::warning
|
||||
|
||||
Multi-scrobbler is **not** designed to be publicly accessible from the internet. To use Webscrobbler outside your local network you should be accessing MS through a VPN or through a reverse proxy with some kind of authentication (though this is still not recommended).
|
||||
|
||||
:::
|
||||
|
||||
### Multiple Users
|
||||
|
||||
If you would like use multiple WebScrobbler sources they can be matched using a **slug** at the end of the **API URL.** This requires using [a file-based config.](/configuration?configType=file#configuration-types)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Example</summary>
|
||||
|
||||
```json title="webscrobbler.json"
|
||||
[
|
||||
{
|
||||
"name": "aUserWS",
|
||||
"clients": [
|
||||
"client1Maloja"
|
||||
],
|
||||
"data": {
|
||||
"slug": "usera"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "bUserWS",
|
||||
"clients": [
|
||||
"client2Maloja"
|
||||
],
|
||||
"data": {
|
||||
"slug": "userb"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
* To use `aUserWS` source set **API URL** to `http://localhost:9078/api/webscrobbler/usera`
|
||||
* To use `bUserWS` source set **API URL** to `http://localhost:9078/api/webscrobbler/userb`
|
||||
|
||||
:::tip
|
||||
|
||||
`http://localhost:9078/api/webscrobbler` is matched with the first source that _that does not have a slug defined._
|
||||
|
||||
:::
|
||||
|
||||
</details>
|
||||
|
||||
### Connectors Black/Whitelist
|
||||
|
||||
MS can be configured to only scrobble, or NOT scrobble, from some WS connectors. Use the name of the website from the [supported websites](https://web-scrobbler.com/) or from the **Connectors** tab in the extension.
|
||||
|
||||
:::note
|
||||
|
||||
This affects **only** MS's behavior and does not affect the general connector behavior you have configured within the WebScrobbler extension.
|
||||
|
||||
:::
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="WebscrobblerSourceConfig" fileContent={JsonConfig} name="webscrobbler">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|---------|--------------------------------------------------------------------------|
|
||||
| WS_ENABLE | No | | Set to 'true' to enable WS without needing to define other ENVs |
|
||||
| WS_WHITELIST | No | | Only scrobble from these WebScrobbler Connectors. Comma-delimited list |
|
||||
| WS_BLACKLIST | No | | Do not scrobble from these WebScrobbler Connectors. Comma-delimited list |
|
||||
</Config>
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: Yamaha MusicCast
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/musiccast.json.example';
|
||||
|
||||
Monitor [MusicCast](https://usa.yamaha.com/products/contents/audio_visual/musiccast/index.html) device/receivers for music played on Network/USB/CD inputs.
|
||||
|
||||
:::tip[Scrobbling Threshold]
|
||||
|
||||
Musiccast may not correctly report track length. If this is the case you should reduce the "listened to" **duration** using [Scrobble Thresholds](/configuration/sources#scrobble-thresholds) so that multi-scrobbler scrobbles correctly.
|
||||
|
||||
:::
|
||||
|
||||
##### URL
|
||||
|
||||
If only a domain/IP:PORT is provided to multi-scrobbler it will automatically append the default Musiccast API path. If your Musiccast device is located behind a custom URL (or reverse proxy) you should explicitly provide the base path to use.
|
||||
|
||||
EX
|
||||
|
||||
| `url` | Transformed URL |
|
||||
| --------------------------------------- | :---------------------------------------------- |
|
||||
| `http://192.168.0.101` | `http://192.168.0.101/YamahaExtendedControl/v1` |
|
||||
| `http://mydomain.com/reverseProxy/cast` | `http://mydomain.com/reverseProxy/cast` |
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="MusicCastSourceConfig" fileContent={JsonConfig} name="musiccast">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
| :--------------------- | :-------- | ------- | :----------------------- |
|
||||
| `MCAST_URL` | Yes | | The Musiccast device URL |
|
||||
</Config>
|
||||
@@ -0,0 +1,189 @@
|
||||
---
|
||||
title: Youtube Music
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 5
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
import JsonConfig from '!!raw-loader!@site/../config/ytmusic.json.example';
|
||||
|
||||
:::warning
|
||||
|
||||
Communication with YT Music is **unofficial** and not supported or endorsed by Google. This means that **this integration may stop working at any time** if Google decides to change how YT Music works in the browser.
|
||||
|
||||
:::
|
||||
|
||||
:::tip[Scrobble Troubleshooting]
|
||||
|
||||
Due to monitoring being unofficial, listening history from YTM can be inconsistent and can cause missed scrobbles.
|
||||
|
||||
[**See the FAQ**](/FAQ.md#youtube-music-misses-or-duplicates-scrobbles) for a detailed explanation, how to see more details about MS's detection of tracks, and how to properly report an issue.
|
||||
|
||||
:::
|
||||
|
||||
#### Authentication {#ytm-auth}
|
||||
|
||||
Only one of these methods needs to be used.
|
||||
|
||||
<Tabs groupId="ytmAuth" queryString>
|
||||
<TabItem value="cookie" label="Cookies">
|
||||
|
||||
Use instructions from
|
||||
|
||||
* https://github.com/patrickkfkan/Volumio-YouTube.js/wiki/How-to-obtain-Cookie or
|
||||
* https://ytmusicapi.readthedocs.io/en/stable/setup/browser.html#copy-authentication-headers
|
||||
|
||||
to get the **Cookie** value from a browser.
|
||||
|
||||
It is highly recommended to [get the cookie from an Incognito/Private Session](https://github.com/LuanRT/YouTube.js/issues/803#issuecomment-2504032666) to limit the chance the session is invalidated from normal browsing.
|
||||
|
||||
Add the cookie to your `ytmusic.json` config in `data` or as an ENV:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "ytmusic",
|
||||
"enable": true,
|
||||
"name": "MyYTM",
|
||||
"data": {
|
||||
"cookie": "__Secure-1PSIDTS=sidts-CjEB3EgAEvCd-......"
|
||||
},
|
||||
"options": {
|
||||
"logAuthUpdateChanges": true,
|
||||
"logDiff": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If MS gives you authentication errors (session invalidated) at some point in the future follow the same instructions to get new cookies.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="oauth" label="OAuth Client">
|
||||
:::warning
|
||||
|
||||
As of Sept 25' OAuth clients no longer seem to have permission to access the YTM service, as reported by the upstream YTM library developer and [several other users.](https://github.com/FoxxMD/multi-scrobbler/issues/345#issuecomment-3258518769)
|
||||
|
||||
If you have existing, working OAuth credentials keep using them but there is no gaurantee they will continue to work.
|
||||
|
||||
If you are setting up the YTM Source for the first time you should first try to use [Cookies](./?ytmAuth=cookie#ytm-auth).
|
||||
|
||||
:::
|
||||
|
||||
[Based on the instructions from here...](https://github.com/LuanRT/YouTube.js/issues/803#issuecomment-2479689924)
|
||||
|
||||
* Login to [Google Cloud console](https://console.cloud.google.com/) (create an account, if necessary)
|
||||
* [Create a new project](https://console.cloud.google.com/projectcreate)
|
||||
* Go to APIs and services.
|
||||
* Configure the OAuth consent screen
|
||||
* Use the old experience if possible
|
||||
* If new is unavoidable then do not fill out any branding and under Authorized Domains you can delete the empty one (in order to save)
|
||||
* Add yourself as an authorized user
|
||||
* Navigate to Credentials
|
||||
* Create Credentials -> choose "OAuth client ID"
|
||||
* Application Type is **Web Application**
|
||||
* **Name** is whatever you want, leave Authorization Javascript origins blank
|
||||
* Authorized redirect URIs
|
||||
* This must be **exactly** the same as what is displayed in MS! For now leave it blank so we can generate it from MS first
|
||||
* Create
|
||||
* In the newly created client popup save the **Client ID** and **Client Secret**, then copy them into `ytmusic.json` or appropriate ENVs:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "ytmusic",
|
||||
"enable": true,
|
||||
"name": "MyYTM",
|
||||
"data": {
|
||||
"clientId": "8910....6jqupl.apps.googleusercontent.com",
|
||||
"clientSecret": "GOCSPX-WGXL6BSuQ343..."
|
||||
},
|
||||
"options": {
|
||||
"logAuthUpdateChanges": true,
|
||||
"logDiff": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now, start MS and during the YTMusic startup it will log something like this:
|
||||
|
||||
```
|
||||
Will use custom OAuth Client:
|
||||
Client ID: ...
|
||||
Client Secret: ...
|
||||
Redirect URI: http://localhost:9078/api/ytmusic/callback?name=MyYTM
|
||||
```
|
||||
|
||||
If the beginning of the Redirect URI (before `api`) is EXACTLY how you would reach the MS dashboard from your browser (EX `http://localhost:9078`) then edit your google oauth client section for `Authorized redirect URIs` and add the URL MS has displayed.
|
||||
|
||||
If it is NOT EXACTLY the same you either need to set MS's [base url](https://foxxmd.github.io/multi-scrobbler/docs/configuration/#base-url) or you can provide your own (Custom) Redirect URI for MS to use by setting it in `ytmusic.json` or ENV.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Using a Custom Redirect URI</summary>
|
||||
|
||||
The three parts of the URL that must be the same:
|
||||
|
||||
* it must start with `api` (after domain or subdirectory IE `my.domain.tld/api...` or `whatever.tld/subDir/api...`
|
||||
* it must end in `ytmusic/callback`
|
||||
* It must include `name=[NameOfSource]` in the query string
|
||||
|
||||
Remember to add your custom URL to the `Authorized redirect URIs` section in the google oauth client!
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "ytmusic",
|
||||
"enable": true,
|
||||
"name": "MyYTM",
|
||||
"data": {
|
||||
"clientId": "8910....6jqupl.apps.googleusercontent.com",
|
||||
"clientSecret": "GOCSPX-WGXL6BSuQ343...",
|
||||
"redirectUri": "http://my.custom.domain/api/ytmusic/callback?name=MyYTM"
|
||||
},
|
||||
"options": {
|
||||
"logAuthUpdateChanges": true,
|
||||
"logDiff": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
AFTER changing the Authorized redirect URIs on Google Cloud console you may need to wait a few minutes for it to take affect. Then restart MS. From the dashboard click `(Re)authenticate` on the YTmusic source card and follow the auth flow:
|
||||
|
||||
* On the screen about "testing" make sure you hit **Continue** (not Back To Safety)
|
||||
* Make sure to select ALL scopes/permissions/grants it asks you about
|
||||
* `Select what [YourAppName] can access` -> Select all
|
||||
|
||||
Once the flow is finished MS will get the credentials and start polling automatically. You should not need to re-authenticate again after restarting MS as it saves the credentials to the `/config` folder.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="ytt" label="YoutubeTV">
|
||||
|
||||
:::warning
|
||||
|
||||
Using the built-in YoutubeTV authentication is unlikely to work due to [Google restricting what permissions TV clients can have](https://github.com/yt-dlp/yt-dlp/issues/11462#issuecomment-2471703090). This authentication method should not be used.
|
||||
|
||||
:::
|
||||
|
||||
To authenticate start multi-scrobbler with an empty YT Music configuration. An authentication URL/code will be logged in additon to being available from the dashboard.
|
||||
|
||||
```
|
||||
ERROR: Sign in with the code 'CLV-KFA-BVKY' using the authentication link on the dashboard or https://www.google.com/device
|
||||
```
|
||||
|
||||
Visit the authentication URL and enter the code that was provided (also available on the dashboard). After completing the setup flow MS will log `Auth success` and the YT Music dashboard card will display as **Idle** after refreshing. Click the **Start** link to begin monitoring.
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
||||
<Config config="YTMusicSourceConfig" fileContent={JsonConfig} name="ytmusic">
|
||||
| Environmental Variable | Required? | Default | Description |
|
||||
|------------------------|-----------|---------|-----------------------------------------------|
|
||||
| YTM_COOKIE | No | | Value for Cookie Authentication |
|
||||
| YTM_CLIENT_ID | No | | Client ID for OAuth Athentication |
|
||||
| YTM_CLIENT_SECRET | No | | Client Secret for OAuth Athentication |
|
||||
| YTM_REDIRECT_URI | No | | A custom redirect URI for OAuth Athentication |
|
||||
| YTM_LOG_DIFF | No | false | Log YTM history changes |
|
||||
</Config>
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"label": "Development",
|
||||
"position": 5,
|
||||
"position": 6,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Developing for Multi-Scrobbler and tutorials"
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
---
|
||||
slug: /
|
||||
title: Overview
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
<img src={require('/img/icon.png').default} align="right" alt="multi-scrobbler logo" width="180" height="180"/>
|
||||
|
||||
A javascript app to scrobble music you listened to, to [Maloja](https://github.com/krateng/maloja), [Last.fm](https://www.last.fm), [ListenBrainz](https://listenbrainz.org), and [Koito](https://koito.io/).
|
||||
|
||||
* Supports scrobbling from many [**Sources**](/configuration/sources)
|
||||
* [Azuracast](/configuration/sources/azuracast)
|
||||
* [Deezer](/configuration/sources/deezer)
|
||||
* [Google Cast (Chromecast)](/configuration/sources/google-cast)
|
||||
* [Icecast](/configuration/sources/icecast)
|
||||
* [Jellyfin](/configuration/sources/jellyfin)
|
||||
* [JRiver](/configuration/sources/jriver)
|
||||
* [Kodi](/configuration/sources/kodi)
|
||||
* [Koito](/configuration/sources/koito-source)
|
||||
* [Last.fm](/configuration/sources/lastfm-source)
|
||||
* [Last.fm (Endpoint)](/configuration/sources/lastfm-endpoint)
|
||||
* [ListenBrainz](/configuration/sources/listenbrainz-source)
|
||||
* [ListenBrainz (Endpoint)](/configuration/sources/listenbrainz-endpoint)
|
||||
* [Maloja](/configuration/sources/maloja)
|
||||
* [Mopidy](/configuration/sources/mopidy)
|
||||
* [MPD (Music Player Daemon)](/configuration/sources/mpd)
|
||||
* [MPRIS (Linux Desktop)](/configuration/sources/mpris)
|
||||
* [Musikcube](/configuration/sources/musikcube)
|
||||
* [Plex](/configuration/sources/plex)
|
||||
* [Rocksky](/configuration/sources/rocksky-source)
|
||||
* [Spotify](/configuration/sources/spotify)
|
||||
* [Subsonic-compatible APIs](/configuration/sources/subsonic) (like [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))
|
||||
* [teal.fm](/configuration/sources/tealfm-source)
|
||||
* [WebScrobbler](/configuration/sources/webscrobbler)
|
||||
* [VLC](/configuration/sources/vlc)
|
||||
* [Yamaha MusicCast](/configuration/sources/yamaha-musiccast)
|
||||
* [Youtube Music](/configuration/sources/youtube-music)
|
||||
* Supports scrobbling to many [**Clients**](/configuration/clients)
|
||||
* [Koito](/configuration/clients/koito)
|
||||
* [Last.fm](/configuration/clients/lastfm)
|
||||
* [ListenBrainz](/configuration/clients/listenbrainz)
|
||||
* [Maloja](/configuration/clients/maloja)
|
||||
* [Rocksky](/configuration/clients/rocksky)
|
||||
* [teal.fm](/configuration/clients/tealfm)
|
||||
* Monitor status of Sources and Clients using [webhooks (Gotify, Ntfy, Apprise)](/configuration#webhook-configurations) or [healthcheck endpoint](/configuration#health-endpoint)
|
||||
* Supports [Now Playing](/configuration/clients#now-playing) for scrobble Clients
|
||||
* Supports configuring for single or multiple users (scrobbling for your friends and family!)
|
||||
* Web server interface for stats, basic control, and detailed logs
|
||||
* Graceful network and client failure handling (queued scrobbles that auto-retry)
|
||||
* Smart handling of credentials (persistent, authorization through app)
|
||||
* Easy configuration through [ENVs or JSON](/configuration#configuration-types)
|
||||
* Modify data before scrobbling with [regular expression or search patterns](/configuration/transforms)
|
||||
* Install using [Docker images for x86/ARM](/installation#docker) or [locally with NodeJS](/installation#nodejs)
|
||||
|
||||
[**Quick Start Guide**](/quickstart)
|
||||
|
||||
<img src={require('/img/status-ui.png').default} width="800"/>
|
||||
|
||||
**Why should I use this over a browser extension and/or mobile app scrobbler?**
|
||||
|
||||
* **Platform independent** -- Because multi-scrobbler communicates directly with service APIs it will scrobble everything you play regardless of where you play it. No more need for apps on every platform you use!
|
||||
* **Open-source** -- Get peace of mind knowing exactly how your personal data is being handled.
|
||||
* **Track your activity regardless of where you listen** -- Scrobble from many Sources to one Client with ease and without duplicating tracks.
|
||||
* **Manage scrobbling for others** -- Scrobble for your friends and family without any setup on their part. Easily silo sources to specific clients to keep plays separate.
|
||||
|
||||
**But I already scrobble my music to Last.fm/ListenBrainz, is multi-scrobbler for me?**
|
||||
|
||||
Yes! You can use [Last.fm as a **Source**](/configuration/sources/lastfm-source) or [Listenbrainz as a **Source**](configuration/sources/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.
|
||||
|
||||
## How Does multi-scrobbler (MS) Work?
|
||||
|
||||
You set up [configurations](/configuration) for one or more [**Sources**](/configuration/sources) and one or more [**Clients**](/configuration/clients). MS monitors all of your configured **Sources**. When new tracks are played by a Source MS grabs that information and then sends it (scrobbles it) to all **Clients** that Source is configured to forward to.
|
||||
|
||||
### Source
|
||||
|
||||
A [**Source**](/configuration/sources) is a data source that contains information about music you are playing or have listened to, like a desktop player, web music player, or cloud music service. Examples are **Spotify, Jellyfin, Plex, Youtube Music, Navidrome**, etc...
|
||||
|
||||
Source configurations consist of:
|
||||
|
||||
* A friendly name.
|
||||
* Any data needed to communicate or authenticate with the Source.
|
||||
* An optional list of Client names that the Source should scrobble to. If omitted the Source also scrobbles to all configured Clients.
|
||||
|
||||
### Client
|
||||
|
||||
A [**Client**](/configuration/clients) is an application that stores the historical information about what music you have played (scrobbles). Examples are **Maloja, Last.fm, Listenbrainz**...
|
||||
|
||||
Client configurations consist of:
|
||||
|
||||
* A friendly name.
|
||||
* Any data needed to communicate or authenticate with the Client.
|
||||
|
||||
## Quick Start
|
||||
|
||||
[See the **Quick Start Guide**](/quickstart)
|
||||
|
||||
## Installation
|
||||
|
||||
[See the **Installation** documentation](/installation)
|
||||
|
||||
## Configuration
|
||||
|
||||
[See the **Configuration** documentation](/configuration)
|
||||
|
||||
## Usage
|
||||
|
||||
A status page with statistics, recent logs, and some runtime configuration options can be found at
|
||||
|
||||
```
|
||||
http://localhost:9078
|
||||
```
|
||||
Output is also provided to stdout/stderr as well as file if specified in configuration.
|
||||
|
||||
On first startup you may need to authorize Spotify and/or Last.fm by visiting the callback URL (which can also be accessed from the status page). Visit the status page above to find the applicable link to trigger this.
|
||||
|
||||
## Help/FAQ
|
||||
|
||||
Having issues with connections or configuration? Check the [FAQ](/FAQ) before creating an issue!
|
||||
|
||||
## Development
|
||||
|
||||
[Detailed architecture and development guides for Sources/Clients](/development/dev-common)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"label": "Installation",
|
||||
"position": 2,
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Way to install Multi-Scrobbler"
|
||||
"type": "doc",
|
||||
"id": "installation/installation"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,16 +166,16 @@ To get the UID and GID for the current user run these commands from a terminal:
|
||||
|
||||
:::tip
|
||||
|
||||
See the [**Quick Start Guide**](../quickstart.mdx) for another guided docker-compose example
|
||||
See the [**Quick Start Guide**](/quickstart) for another guided docker-compose example
|
||||
|
||||
:::
|
||||
|
||||
The example scenario:
|
||||
|
||||
* [Jellyfin **Source**](../configuration/configuration.mdx#jellyfin)
|
||||
* [Maloja **Client**](../configuration/configuration.mdx#maloja)
|
||||
* [Jellyfin **Source**](/configuration/sources/jellyfin)
|
||||
* [Maloja **Client**](/configuration/sources/maloja)
|
||||
* Serving app on port `9078`
|
||||
* Docker container located on a different IP (`192.168.0.100`) so use [Base URL](../configuration/configuration.mdx#base-url)
|
||||
* Docker container located on a different IP (`192.168.0.100`) so use [Base URL](/configuration#base-url)
|
||||
* Config/data directory on host machine in a directory next to `docker-compose.yml`
|
||||
* Linux uid/gid is `1000:1000`
|
||||
|
||||
|
||||
+15
-15
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 'Quickstart'
|
||||
sidebar_position: 1
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
@@ -10,8 +10,8 @@ This guide will get you up and running with multi-scrobbler using [Docker](https
|
||||
|
||||
* the dashboard served on port `9078` of a host machine which has an IP of `192.168.0.100`
|
||||
* data saved to the same directory as the `docker-compose.yml` file
|
||||
* multi-scrobbler monitoring [Spotify](./configuration/configuration.mdx#spotify) and/or [Jellyfin](./configuration/configuration.mdx#jellyfin) for listening activity
|
||||
* multi-scrobbler scrobbling to [Lastfm](./configuration/configuration.mdx#lastfm) and/or [Maloja](./configuration/configuration.mdx#maloja)
|
||||
* multi-scrobbler monitoring [Spotify](/configuration/sources/spotify) and/or [Jellyfin](/configuration/sources/jellyfin) for listening activity
|
||||
* multi-scrobbler scrobbling to [Lastfm](/configuration/clients/lastfm) and/or [Maloja](/configuration/clients/maloja)
|
||||
|
||||
:::note
|
||||
|
||||
@@ -42,11 +42,11 @@ services:
|
||||
|
||||
## Setup Sources
|
||||
|
||||
**Sources** are the services multi-scrobbler monitors to look for listening activity.
|
||||
[**Sources**](/configuration/sources) are the services/music players multi-scrobbler monitors to look for listening activity.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="jellyfin" label="Jellyfin">
|
||||
Follow the Jellyfin configuration [instructions for setting up an **API Key**.](./configuration/configuration.mdx#jellyfin)
|
||||
Follow the Jellyfin configuration [instructions for setting up an **API Key**.](/configuration/sources/jellyfin)
|
||||
|
||||
Then, add these values to the `environment` section in the [`docker-compose.yml` you created.](#create-docker-compose-file)
|
||||
|
||||
@@ -60,7 +60,7 @@ services:
|
||||
To access your Spotify activity you must [create a Spotify App](https://developer.spotify.com/dashboard) to get a
|
||||
**Client ID/Secret** and set a valid **Redirect URI**.
|
||||
|
||||
Refer to the [Spotify Authentication instructions in the docs.](./configuration/configuration.mdx#authenticate-spotify-with-multi-scrobbler)
|
||||
Refer to the [Spotify Authentication instructions in the docs.](/configuration/sources/spotify#authenticate-spotify-with-multi-scrobbler)
|
||||
|
||||
Assuming you used the **HTTPS** method for your **Redirect URI** from the instructions above...after the application is created add these values to the `environment` section in the [`docker-compose.yml` you created.](#create-docker-compose-file)
|
||||
|
||||
@@ -76,7 +76,7 @@ services:
|
||||
|
||||
## Setup Clients
|
||||
|
||||
**Clients** are services that store scrobbles. Multi-scrobbler will scrobble all listening activity from the **Sources** you configured to all **Clients** you configure here.
|
||||
[**Clients**](/configuration/clients) are services that store scrobbles. Multi-scrobbler will scrobble all listening activity from the **Sources** you configured to all **Clients** you configure here.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="maloja" label="Maloja">
|
||||
@@ -138,7 +138,7 @@ services:
|
||||
* Determine your Koito URL
|
||||
* This is the URL you use to access your Koito dashboard OR whatever URL is accessible from your multi-scrobbler instance.
|
||||
* EX dashboard at `http://192.168.0.100:4110` => replace `myURL` below with `http://192.168.0.100:4110`
|
||||
* [More info on the URL to use is the full docs](./configuration/configuration.mdx#koito)
|
||||
* [More info on the URL to use is the full docs](/configuration/clients/koito)
|
||||
|
||||
Add/Substitute values above into these examples values and add them to the `environment` section in the [`docker-compose.yml` you created for multi-scrobbler earlier.](#create-docker-compose-file)
|
||||
|
||||
@@ -161,7 +161,7 @@ services:
|
||||
|
||||
:::tip
|
||||
|
||||
If you are running your multi-scrobbler container on a Linux host see [these instructions for setting proper file permissions.](./installation/installation.mdx#linux-host)
|
||||
If you are running your multi-scrobbler container on a Linux host see [these instructions for setting proper file permissions.](/installation#linux-host)
|
||||
|
||||
:::
|
||||
|
||||
@@ -182,10 +182,10 @@ Visit `http://192.168.0.100:9078` to see the dashboard where
|
||||
|
||||
## Next Steps
|
||||
|
||||
* See more advanced docker options as well as other install methods in the [**Installation**](./installation/installation.mdx#docker) docs
|
||||
* Review the [**Configuration**](./configuration/configuration.mdx) docs
|
||||
* See more advanced docker options as well as other install methods in the [**Installation**](/installation#docker) docs
|
||||
* Review the [**Configuration**](/configuration) docs
|
||||
* Learn about how to configure multi-scrobbler using files for more complicated Source/Client scenarios
|
||||
* See all available Sources/Clients alongside configuration examples
|
||||
* Learn how to set up [notification webhooks](./configuration/configuration.mdx#webhook-configurations)
|
||||
* Check out the [kitchensink example](./configuration/kitchensink.md)
|
||||
* Consult the [**FAQ**](./FAQ.md) for solutions to common problems
|
||||
* See all available [**Sources**](/configuration/sources) and [**Clients**](/configuration/clients) alongside configuration examples
|
||||
* Learn how to set up [notification webhooks](/configuration#webhook-configurations)
|
||||
* Check out the [kitchensink example](/configuration/kitchensink)
|
||||
* Consult the [**FAQ**](/FAQ) for solutions to common problems
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"label": "Updating",
|
||||
"position": 3,
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Way to update Multi-Scrobbler"
|
||||
|
||||
@@ -49,6 +49,7 @@ const config: Config = {
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: './sidebars.ts',
|
||||
routeBasePath: '/',
|
||||
// Please change this to your repo.
|
||||
// Remove this to remove the "edit this page" links.
|
||||
editUrl:
|
||||
@@ -79,6 +80,7 @@ const config: Config = {
|
||||
// `hashed` is recommended as long-term-cache of index file is possible.
|
||||
hashed: true,
|
||||
indexBlog: false,
|
||||
docsRouteBasePath: "/",
|
||||
// For Docs using Chinese, The `language` is recommended to set to:
|
||||
// ```
|
||||
// language: ["en", "zh"],
|
||||
@@ -88,6 +90,38 @@ const config: Config = {
|
||||
'docusaurus-theme-github-codeblock'
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-client-redirects',
|
||||
{
|
||||
redirects: [
|
||||
// /docs/oldDoc -> /docs/newDoc
|
||||
{
|
||||
to: '/configuration',
|
||||
from: '/docs/configuration',
|
||||
},
|
||||
{
|
||||
to: '/configuration/kitchensink',
|
||||
from: '/docs/configuration/kitchensink',
|
||||
},
|
||||
{
|
||||
to: '/installation',
|
||||
from: '/docs/installation',
|
||||
},
|
||||
{
|
||||
to: '/quickstart',
|
||||
from: '/docs/quickstart',
|
||||
},
|
||||
{
|
||||
to: '/FAQ',
|
||||
from: '/docs/FAQ',
|
||||
},
|
||||
{
|
||||
to: '/',
|
||||
from: '/docs',
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
themeConfig:
|
||||
{
|
||||
@@ -137,15 +171,15 @@ const config: Config = {
|
||||
},
|
||||
{
|
||||
label: 'Installation',
|
||||
to: 'docs/installation',
|
||||
to: '/installation',
|
||||
},
|
||||
{
|
||||
label: 'Configuration',
|
||||
to: 'docs/configuration',
|
||||
to: '/configuration',
|
||||
},
|
||||
{
|
||||
label: 'Development',
|
||||
to: 'docs/development/dev-common',
|
||||
to: '/development/dev-common',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Generated
+25
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.8.1",
|
||||
"@docusaurus/faster": "3.8.1",
|
||||
"@docusaurus/plugin-client-redirects": "^3.8.1",
|
||||
"@docusaurus/preset-classic": "3.8.1",
|
||||
"@easyops-cn/docusaurus-search-local": "0.51.1",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
@@ -3406,6 +3407,30 @@
|
||||
"react-dom": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@docusaurus/plugin-client-redirects": {
|
||||
"version": "3.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.8.1.tgz",
|
||||
"integrity": "sha512-F+86R7PBn6VNgy/Ux8w3ZRypJGJEzksbejQKlbTC8u6uhBUhfdXWkDp6qdOisIoW0buY5nLqucvZt1zNJzhJhA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.8.1",
|
||||
"@docusaurus/logger": "3.8.1",
|
||||
"@docusaurus/utils": "3.8.1",
|
||||
"@docusaurus/utils-common": "3.8.1",
|
||||
"@docusaurus/utils-validation": "3.8.1",
|
||||
"eta": "^2.2.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"lodash": "^4.17.21",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@docusaurus/plugin-content-blog": {
|
||||
"version": "3.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.8.1.tgz",
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.8.1",
|
||||
"@docusaurus/faster": "3.8.1",
|
||||
"@docusaurus/plugin-client-redirects": "^3.8.1",
|
||||
"@docusaurus/preset-classic": "3.8.1",
|
||||
"@easyops-cn/docusaurus-search-local": "0.51.1",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
|
||||
<Tabs groupId="configType" queryString>
|
||||
<TabItem value="env" label="ENV">
|
||||
<EnvType>
|
||||
{props.children}
|
||||
</EnvType>
|
||||
</TabItem>
|
||||
<TabItem value="file" label="File">
|
||||
<FileType>
|
||||
|
||||
<FileExample title={`CONFIG/${props.name}.json`} client={props.client ?? false} data={props.fileContent}/>
|
||||
|
||||
or <SchemaLink lower objectName={props.config}/>
|
||||
</FileType>
|
||||
</TabItem>
|
||||
<TabItem value="aio" label="AIO">
|
||||
<AIOType>
|
||||
|
||||
<AIOExample data={props.fileContent} client={props.client ?? false} name={props.name}/>
|
||||
|
||||
|
||||
or <SchemaLink lower objectName={props.config}/>
|
||||
</AIOType>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -0,0 +1,2 @@
|
||||
[**AIO** Config Type](/configuration?configType=aio#configuration-types)
|
||||
{props.children}
|
||||
@@ -0,0 +1,14 @@
|
||||
import CodeInline from '@theme/CodeInline';
|
||||
|
||||
The [AT Protocol](https://docs.bsky.app/docs/advanced-guides/atproto) is a standard to allow different applications to share and interpret your social data.
|
||||
|
||||
Your data is stored in a personal [repository](https://atproto.com/guides/data-repos) in a [PDS (Personal Data Server)](https://github.com/Bluesky-social/pds), which is data-type agnostic (it's just JSON). Each application defines their own datatypes and pulls data from your repository to render to you, your network, etc...
|
||||
|
||||
Even though the application and the PDS/repository are independent, all of this is done for you automatically when you create a [Bluesky](https://bsky.social/about) account.
|
||||
|
||||
So...
|
||||
|
||||
* multi-scrobbler "scrobbles" your plays to your repository
|
||||
* in a JSON data structure which includes [{props.name}'s data type and structure](https://atproto.com/specs/lexicon)
|
||||
* at a [known location for {props.name}'s data](https://atproto.com/guides/glossary#collection) (<CodeInline>{props.lexicon}</CodeInline>), in a list that is appended to as you continue to scrobble
|
||||
* when accessing {props.name}, or another application that knows how to read it, your data is pulled from the repository to render the app
|
||||
@@ -0,0 +1,3 @@
|
||||
[**ENV** Config Type](/configuration?configType=env#configuration-types)
|
||||
|
||||
{props.children}
|
||||
@@ -0,0 +1,3 @@
|
||||
[**File** Config Type](/configuration?configType=file#configuration-types)
|
||||
|
||||
{props.children}
|
||||
@@ -0,0 +1,27 @@
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
|
||||
A **Source** that monitors active listening uses one of two metrics to determine if a Song is scrobbable based on your listening:
|
||||
|
||||
* **percent** of track listened to (50% or more)
|
||||
* or amount of time (**duration**) track was listened to (4 minutes or more)
|
||||
|
||||
These default values are based on [last.fm's scrobble guidance.](https://www.last.fm/api/scrobbling#when-is-a-scrobble-a-scrobble)
|
||||
|
||||
These values can be customized in the `options` of Source's [file or aio config](/configuration#configuration-types):
|
||||
<CodeBlock
|
||||
language="json5"
|
||||
title={`${props.filename}.json`}>
|
||||
{`{
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
"options": {
|
||||
// highlight-start
|
||||
"scrobbleThresholds": {
|
||||
"duration": 40, // scrobbable if listened to for 40 seconds or more
|
||||
"percent": 20 // scrobbable if listened to for 20% or more of the track's length
|
||||
}
|
||||
// highlight-end
|
||||
}
|
||||
}`}
|
||||
</CodeBlock>
|
||||
@@ -0,0 +1,22 @@
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
|
||||
This **Source** supports toggling scrobbling on or off manually. This action can be taken on the Web Dashboard by clicking the link next to **Should Scrobble** found in each Source's status card.
|
||||
|
||||
Additionally, the default behavior for scrobbling can be explicitly set by adding the following value to a Source's `options` in [file or aio config](/configuration?configType=file#configuration-types):
|
||||
|
||||
<CodeBlock
|
||||
language="json5"
|
||||
title={`${props.filename}.json`}>
|
||||
{`{
|
||||
"data": {
|
||||
// ...
|
||||
},
|
||||
"options": {
|
||||
// highlight-start
|
||||
// set to true to always scrobble automatically
|
||||
// set to false to never scrobble automatically
|
||||
"systemScrobble": true
|
||||
// highlight-end
|
||||
}
|
||||
}}`}
|
||||
</CodeBlock>
|
||||
@@ -0,0 +1,3 @@
|
||||
This component **recieves data** from outside services, rather than actively contacting the outside service for data itself.
|
||||
|
||||
In order for it to work multi-scrobbler must be accessible, on an open port or through reverse-proxy, to the service that will be sending data to it.
|
||||
@@ -1,126 +0,0 @@
|
||||
---
|
||||
title: Overview
|
||||
---
|
||||
|
||||
# Overview
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
<img src={require('/img/icon.png').default} align="right" alt="multi-scrobbler logo" width="180" height="180"/>
|
||||
|
||||
A javascript app to scrobble music you listened to, to [Maloja](https://github.com/krateng/maloja), [Last.fm](https://www.last.fm), [ListenBrainz](https://listenbrainz.org), and [Koito](https://koito.io/).
|
||||
|
||||
* Supports scrobbling from many **Sources**
|
||||
* [Azuracast](docs/configuration#azuracast)
|
||||
* [Deezer](docs/configuration#deezer)
|
||||
* [Google Cast (Chromecast)](docs/configuration#google-cast-chromecast)
|
||||
* [Icecast](docs/configuration#icecast)
|
||||
* [Jellyfin](docs/configuration#jellyfin)
|
||||
* [JRiver](docs/configuration#jriver)
|
||||
* [Kodi](docs/configuration#kodi)
|
||||
* [Koito](docs/configuration#koito-source)
|
||||
* [Last.fm](docs/configuration#lastfm-source)
|
||||
* [Last.fm (Endpoint)](docs/configuration#lastfm-endpoint)
|
||||
* [ListenBrainz](docs/configuration#listenbrainz-source)
|
||||
* [ListenBrainz (Endpoint)](docs/configuration#listenbrainz-endpoint)
|
||||
* [Maloja](docs/configuration#maloja-source)
|
||||
* [Mopidy](docs/configuration#mopidy)
|
||||
* [MPD (Music Player Daemon)](docs/configuration#mpd-music-player-daemon)
|
||||
* [MPRIS (Linux Desktop)](docs/configuration#mpris)
|
||||
* [Musikcube](docs/configuration#musikcube)
|
||||
* [Plex](docs/configuration#plex) or [~~Tautulli~~](docs/configuration#tautulli)
|
||||
* [Spotify](docs/configuration#spotify)
|
||||
* [Subsonic-compatible APIs](docs/configuration#subsonic) (like [Airsonic](https://airsonic.github.io/) and [Navidrome](https://www.navidrome.org/))
|
||||
* [WebScrobbler](docs/configuration#webscrobbler)
|
||||
* [VLC](docs/configuration#vlc)
|
||||
* [Yamaha MusicCast](docs/configuration#yamaha-musiccast)
|
||||
* [Youtube Music](docs/configuration#youtube-music)
|
||||
* Supports scrobbling to many **Clients**
|
||||
* [Koito](docs/configuration#koito)
|
||||
* [Last.fm](docs/configuration#lastfm)
|
||||
* [ListenBrainz](docs/configuration#listenbrainz)
|
||||
* [Maloja](docs/configuration#maloja)
|
||||
* Monitor status of Sources and Clients using [webhooks (Gotify, Ntfy, Apprise)](docs/configuration#webhook-configurations) or [healthcheck endpoint](docs/configuration#health-endpoint)
|
||||
* Supports [Now Playing](docs/configuration#now-playing) for scrobble Clients
|
||||
* Supports configuring for single or multiple users (scrobbling for your friends and family!)
|
||||
* Web server interface for stats, basic control, and detailed logs
|
||||
* Graceful network and client failure handling (queued scrobbles that auto-retry)
|
||||
* Smart handling of credentials (persistent, authorization through app)
|
||||
* Easy configuration through ENVs or JSON
|
||||
* Modify data before scrobbling with [regular expression or search patterns](docs/configuration/transforms)
|
||||
* Install using [Docker images for x86/ARM](docs/installation#docker) or [locally with NodeJS](docs/installation#nodejs)
|
||||
|
||||
[**Quick Start Guide**](docs/quickstart)
|
||||
|
||||
<img src={require('/img/status-ui.png').default} width="800"/>
|
||||
|
||||
**Why should I use this over a browser extension and/or mobile app scrobbler?**
|
||||
|
||||
* **Platform independent** -- Because multi-scrobbler communicates directly with service APIs it will scrobble everything you play regardless of where you play it. No more need for apps on every platform you use!
|
||||
* **Open-source** -- Get peace of mind knowing exactly how your personal data is being handled.
|
||||
* **Track your activity regardless of where you listen** -- Scrobble from many Sources to one Client with ease and without duplicating tracks.
|
||||
* **Manage scrobbling for others** -- Scrobble for your friends and family without any setup on their part. Easily silo sources to specific clients to keep plays separate.
|
||||
|
||||
**But I already scrobble my music to Last.fm/ListenBrainz, is multi-scrobbler for me?**
|
||||
|
||||
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.
|
||||
|
||||
## How Does multi-scrobbler (MS) Work?
|
||||
|
||||
You set up configurations for one or more **Sources** and one or more **Clients**. MS monitors all of your configured **Sources**. When new tracks are played by a Source it grabs that information and then sends it (scrobbles it) to all **Clients** that Source is configured to scrobble to.
|
||||
|
||||
### Source
|
||||
|
||||
A **Source** is a data source that contains information about tracks you are playing like a music player or platform. Examples are **Spotify, Jellyfin, Plex, Youtube Music, Airsonic**, etc...
|
||||
|
||||
Source configurations consist of:
|
||||
|
||||
* A friendly name.
|
||||
* Any data needed to communicate or authenticate with the Source.
|
||||
* An optional list of Client names that the Source should scrobble to. If omitted the Source also scrobbles to all configured Clients.
|
||||
|
||||
### Client
|
||||
|
||||
A **Client** is an application that stores the historical information about what songs you have played (scrobbles). Examples are **Maloja, Last.fm, Listenbrainz**...
|
||||
|
||||
Client configurations consist of:
|
||||
|
||||
* A friendly name.
|
||||
* Any data needed to communicate or authenticate with the Client.
|
||||
|
||||
## Quick Start
|
||||
|
||||
[See the **Quick Start Guide**](docs/quickstart)
|
||||
|
||||
## Installation
|
||||
|
||||
[See the **Installation** documentation](docs/installation)
|
||||
|
||||
## Configuration
|
||||
|
||||
[See the **Configuration** documentation](docs/configuration)
|
||||
|
||||
## Usage
|
||||
|
||||
A status page with statistics, recent logs, and some runtime configuration options can be found at
|
||||
|
||||
```
|
||||
http://localhost:9078
|
||||
```
|
||||
Output is also provided to stdout/stderr as well as file if specified in configuration.
|
||||
|
||||
On first startup you may need to authorize Spotify and/or Last.fm by visiting the callback URL (which can also be accessed from the status page). Visit the status page above to find the applicable link to trigger this.
|
||||
|
||||
## Help/FAQ
|
||||
|
||||
Having issues with connections or configuration? Check the [FAQ](docs/FAQ) before creating an issue!
|
||||
|
||||
## Development
|
||||
|
||||
[Detailed architecture and development guides for Sources/Clients](docs/development/dev-common)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
// Import the original mapper
|
||||
import MDXComponents from '@theme-original/MDXComponents';
|
||||
import SchemaLink from "@site/src/components/SchemaLink";
|
||||
import AIOExample from "@site/src/components/AIOExample";
|
||||
import FileExample from "@site/src/components/FileExample";
|
||||
import EnvType from "@site/src/components/snippets/_env-config.mdx";
|
||||
import FileType from "@site/src/components/snippets/_file-config.mdx";
|
||||
import AIOType from "@site/src/components/snippets/_aio-config.mdx";
|
||||
import Config from "@site/src/components/GenericConfiguration.mdx";
|
||||
|
||||
export default {
|
||||
// Re-use the default mapping
|
||||
...MDXComponents,
|
||||
SchemaLink,
|
||||
AIOExample,
|
||||
FileExample,
|
||||
EnvType,
|
||||
FileType,
|
||||
AIOType,
|
||||
Config
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
Sitemap: https://foxxmd.github.io/multi-scrobbler/sitemap.xml
|
||||
|
||||
User-agent: *
|
||||
Allow: /
|
||||
File diff suppressed because one or more lines are too long
Generated
+1030
-493
File diff suppressed because it is too large
Load Diff
+8
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-scrobbler",
|
||||
"version": "0.9.11",
|
||||
"version": "0.10.2",
|
||||
"type": "module",
|
||||
"description": "scrobble plays from multiple sources to multiple clients",
|
||||
"scripts": {
|
||||
@@ -43,6 +43,9 @@
|
||||
"homepage": ".",
|
||||
"dependencies": {
|
||||
"@astronautlabs/mdns": "^1.0.7",
|
||||
"@atcute/identity-resolver-node": "^1.0.3",
|
||||
"@atproto/api": "^0.18.0",
|
||||
"@atproto/oauth-client-node": "^0.3.10",
|
||||
"@awaitjs/express": "^0.6.3",
|
||||
"@curvenote/ansi-to-react": "^7.0.0",
|
||||
"@donedeal0/superdiff": "^1.1.1",
|
||||
@@ -62,6 +65,7 @@
|
||||
"@react-nano/use-event-source": "^0.13.0",
|
||||
"@reduxjs/toolkit": "^1.9.5",
|
||||
"@supercharge/promise-pool": "^3.0.0",
|
||||
"@tailwindcss/vite": "^4.1.16",
|
||||
"@types/express-serve-static-core": "^4.19.6",
|
||||
"address": "^1.2.2",
|
||||
"ajv": "^8.12.0",
|
||||
@@ -100,22 +104,21 @@
|
||||
"mopidy": "^1.3.0",
|
||||
"mpd-api": "^1.1.2",
|
||||
"nanoid": "^3.3.1",
|
||||
"node-object-hash": "^3.1.1",
|
||||
"normalize-url": "^8.0.1",
|
||||
"ntfy": "^1.7.6",
|
||||
"object-hash": "^3.0.0",
|
||||
"p-event": "^4.2.0",
|
||||
"passport": "^0.6.0",
|
||||
"passport-deezer": "^0.2.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"postcss": "^8.4.41",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-redux": "^8.1.2",
|
||||
"react-router-dom": "^6.15.0",
|
||||
"sass": "^1.70.0",
|
||||
"sass": "^1.93.3",
|
||||
"spotify-web-api-node": "^5.0.2",
|
||||
"superagent": "^8.0.9",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"tailwindcss": "^4.1.16",
|
||||
"toad-scheduler": "^3.0.0",
|
||||
"tough-cookie": "^5.1.2",
|
||||
"ts-json-schema-generator": "^2.3.0",
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import { childLogger, Logger } from '@foxxmd/logging';
|
||||
import { projectDir } from './index.js';
|
||||
import path from 'path';
|
||||
import { fileOrDirectoryIsWriteable } from '../utils.js';
|
||||
import { asCacheMetadataProvider, asCacheScrobbleProvider, CacheConfig, CacheConfigOptions, CacheMetadaProvider, CacheProvider, CacheScrobbleProvider } from './infrastructure/Atomic.js';
|
||||
import { asCacheAuthProvider, asCacheMetadataProvider, asCacheScrobbleProvider, CacheAuthProvider, CacheConfig, CacheConfigOptions, CacheMetadataProvider, CacheProvider, CacheScrobbleProvider } from './infrastructure/Atomic.js';
|
||||
import { Typeson } from 'typeson';
|
||||
import { builtin } from 'typeson-registry';
|
||||
import { MaybeLogger } from './logging.js';
|
||||
@@ -46,6 +46,7 @@ export class MSCache {
|
||||
|
||||
cacheMetadata: Cacheable;
|
||||
cacheScrobble: Cacheable;
|
||||
cacheAuth: Cacheable;
|
||||
|
||||
logger: Logger;
|
||||
|
||||
@@ -54,7 +55,7 @@ export class MSCache {
|
||||
|
||||
const {
|
||||
metadata: {
|
||||
provider: mProvider = (process.env.CACHE_METADATA as (CacheMetadaProvider | undefined) ?? 'memory'),
|
||||
provider: mProvider = (process.env.CACHE_METADATA as (CacheMetadataProvider | undefined) ?? 'memory'),
|
||||
connection: mConn = process.env.CACHE_METADATA_CONN,
|
||||
...restMetadata
|
||||
} = {},
|
||||
@@ -63,6 +64,11 @@ export class MSCache {
|
||||
connection = (process.env.CACHE_SCROBBLE_CONN ?? configDir),
|
||||
...restScrobble
|
||||
} = {},
|
||||
auth: {
|
||||
provider: aProvider = (process.env.CACHE_AUTH as (CacheAuthProvider | undefined) ?? 'file'),
|
||||
connection: aConn = (process.env.CACHE_AUTH_CONN ?? configDir),
|
||||
...restAuth
|
||||
} = {},
|
||||
} = config;
|
||||
|
||||
this.config = {
|
||||
@@ -75,6 +81,11 @@ export class MSCache {
|
||||
provider: sProvider,
|
||||
connection,
|
||||
...restScrobble
|
||||
},
|
||||
auth: {
|
||||
provider: aProvider,
|
||||
connection: aConn,
|
||||
...restAuth
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -83,6 +94,7 @@ export class MSCache {
|
||||
// disabled for now
|
||||
//await this.initMetadataCache();
|
||||
await this.initScrobbleCache();
|
||||
await this.initAuthCache();
|
||||
}
|
||||
|
||||
protected initCacheable = async (config: CacheConfig, cacheFor: string) => {
|
||||
@@ -147,6 +159,17 @@ export class MSCache {
|
||||
this.cacheMetadata = await this.initCacheable(this.config.metadata, 'Metadata');
|
||||
}
|
||||
}
|
||||
|
||||
initAuthCache = async () => {
|
||||
if (this.cacheAuth === undefined) {
|
||||
if (!asCacheAuthProvider(this.config.auth.provider)) {
|
||||
throw new Error(`Cache Auth provider '${this.config.auth.provider}' must be one of: memory, valkey, file`);
|
||||
}
|
||||
|
||||
this.cacheAuth = await this.initCacheable(this.config.auth, 'Auth');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ export type SourceType =
|
||||
| 'vlc'
|
||||
| 'icecast'
|
||||
| 'azuracast'
|
||||
| 'koito';
|
||||
| 'koito'
|
||||
| 'tealfm'
|
||||
| 'rocksky';
|
||||
|
||||
export const sourceTypes: SourceType[] = [
|
||||
'spotify',
|
||||
@@ -59,7 +61,9 @@ export const sourceTypes: SourceType[] = [
|
||||
'vlc',
|
||||
'icecast',
|
||||
'azuracast',
|
||||
'koito'
|
||||
'koito',
|
||||
'tealfm',
|
||||
'rocksky'
|
||||
];
|
||||
|
||||
export const isSourceType = (data: string): data is SourceType => {
|
||||
@@ -72,12 +76,16 @@ export type ClientType =
|
||||
'maloja'
|
||||
| 'lastfm'
|
||||
| 'listenbrainz'
|
||||
| 'koito';
|
||||
| 'koito'
|
||||
| 'tealfm'
|
||||
| 'rocksky';
|
||||
export const clientTypes: ClientType[] = [
|
||||
'maloja',
|
||||
'lastfm',
|
||||
'listenbrainz',
|
||||
'koito'
|
||||
'koito',
|
||||
'tealfm',
|
||||
'rocksky'
|
||||
];
|
||||
export const isClientType = (data: string): data is ClientType => {
|
||||
return clientTypes.includes(data as ClientType);
|
||||
@@ -355,8 +363,8 @@ export interface CacheConfig<T extends CacheProvider = CacheProvider> {
|
||||
connection?: string;
|
||||
[key: string]: any
|
||||
}
|
||||
export type CacheMetadaProvider = CacheProvider;//Exclude<CacheProvider, 'file'>;
|
||||
export type CacheMetadataConfig = CacheConfig<CacheMetadaProvider>;
|
||||
export type CacheMetadataProvider = CacheProvider;//Exclude<CacheProvider, 'file'>;
|
||||
export type CacheMetadataConfig = CacheConfig<CacheMetadataProvider>;
|
||||
export const asCacheProvider = (val: boolean | string): val is CacheProvider => {
|
||||
if(typeof val === 'string') {
|
||||
return ['memory', 'valkey', 'file'].includes(val);
|
||||
@@ -367,8 +375,13 @@ export const asCacheMetadataProvider = (val: any): val is CacheScrobbleProvider
|
||||
export type CacheScrobbleProvider = CacheProvider;
|
||||
export type CacheScrobbleConfig = CacheConfig<CacheScrobbleProvider>;
|
||||
export const asCacheScrobbleProvider = (val: any): val is CacheScrobbleProvider => asCacheProvider(val);
|
||||
|
||||
export type CacheAuthProvider = CacheProvider;
|
||||
export type CacheAuthConfig = CacheConfig<CacheAuthProvider>;
|
||||
export const asCacheAuthProvider = (val: any): val is CacheAuthProvider => asCacheProvider(val);
|
||||
export interface CacheConfigOptions {
|
||||
metadata?: CacheMetadataConfig;
|
||||
scrobble?: CacheScrobbleConfig;
|
||||
auth?: CacheAuthConfig;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { KoitoClientAIOConfig, KoitoClientConfig } from "./koito.js";
|
||||
import { LastfmClientAIOConfig, LastfmClientConfig } from "./lastfm.js";
|
||||
import { ListenBrainzClientAIOConfig, ListenBrainzClientConfig } from "./listenbrainz.js";
|
||||
import { MalojaClientAIOConfig, MalojaClientConfig } from "./maloja.js";
|
||||
import { TealClientAIOConfig, TealClientConfig } from "./tealfm.js";
|
||||
import { RockSkyClientAIOConfig, RockSkyClientConfig } from "./rocksky.js";
|
||||
|
||||
export type ClientConfig = MalojaClientConfig | LastfmClientConfig | ListenBrainzClientConfig | KoitoClientConfig;
|
||||
export type ClientConfig = MalojaClientConfig | LastfmClientConfig | ListenBrainzClientConfig | KoitoClientConfig | TealClientConfig | RockSkyClientConfig;
|
||||
|
||||
export type ClientAIOConfig = MalojaClientAIOConfig | LastfmClientAIOConfig | ListenBrainzClientAIOConfig | KoitoClientAIOConfig;
|
||||
export type ClientAIOConfig = MalojaClientAIOConfig | LastfmClientAIOConfig | ListenBrainzClientAIOConfig | KoitoClientAIOConfig | TealClientAIOConfig | RockSkyClientAIOConfig;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
import { RequestRetryOptions } from "../common.js";
|
||||
import { CommonClientConfig, CommonClientData, CommonClientOptions, NowPlayingOptions } from "./index.js";
|
||||
|
||||
export interface RockSkyData extends RequestRetryOptions{
|
||||
|
||||
/**
|
||||
* API Key generated from [API Applications](https://docs.rocksky.app/migrating-from-listenbrainz-to-rocksky-1040189m0) in Rocksky for your account
|
||||
*
|
||||
* @examples ["6794186bf-1157-4de6-80e5-uvb411f3ea2b"]
|
||||
* */
|
||||
key: string
|
||||
|
||||
/**
|
||||
* The **fully-qualified** handle for your ATPRoto/Bluesky account, like:
|
||||
*
|
||||
* * alice.bsky.social
|
||||
* * foxxmd.com
|
||||
* * mysuer.blacksky.app
|
||||
*
|
||||
* */
|
||||
handle: string
|
||||
}
|
||||
|
||||
export interface RockSkyClientData extends RockSkyData, CommonClientData {}
|
||||
|
||||
export interface RockSkyOptions {
|
||||
/**
|
||||
* URL for the Rocksky *Listenbrainz* endpoint, if not using the default
|
||||
*
|
||||
* @examples ["https://audioscrobbler.rocksky.app"]
|
||||
* @default "https://audioscrobbler.rocksky.app"
|
||||
* */
|
||||
audioScrobblerUrl?: string
|
||||
|
||||
/**
|
||||
* URL for the Rocksky *API* endpoint, if not using the default
|
||||
*
|
||||
* @examples ["https://api.rocksky.app"]
|
||||
* @default "https://api.rocksky.app"
|
||||
* */
|
||||
apiUrl?: string
|
||||
}
|
||||
|
||||
export interface RockSkyClientOptions extends RockSkyOptions, CommonClientOptions, NowPlayingOptions {
|
||||
|
||||
}
|
||||
|
||||
export interface RockSkyClientConfig extends CommonClientConfig {
|
||||
/**
|
||||
* Should always be `client` when using RockSky as a client
|
||||
*
|
||||
* @default client
|
||||
* @examples ["client"]
|
||||
* */
|
||||
configureAs?: 'client' | 'source'
|
||||
data: RockSkyClientData
|
||||
options?: RockSkyClientOptions
|
||||
}
|
||||
|
||||
export interface RockSkyClientAIOConfig extends RockSkyClientConfig {
|
||||
type: 'rocksky'
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import { RequestRetryOptions } from "../common.js"
|
||||
import { CommonClientConfig, CommonClientData, CommonClientOptions } from "./index.js"
|
||||
|
||||
export interface TealData extends RequestRetryOptions {
|
||||
/**
|
||||
* The base URI of the Multi-Scrobbler to use for ATProto OAuth
|
||||
*
|
||||
* Only include this if you want to use OAuth. The URI must be a non-IP/non-local domain using https: protocol.
|
||||
*/
|
||||
baseUri?: string
|
||||
/**
|
||||
* Identify the account to login as
|
||||
*
|
||||
* * For **App Password** Auth - your email
|
||||
* * For **Oauth** - your handle minus the @
|
||||
*/
|
||||
identifier: string
|
||||
/**
|
||||
* The [App Password](https://atproto.com/specs/xrpc#app-passwords) you created for your account
|
||||
*
|
||||
* This is created under https://bsky.app/settings/app-passwords
|
||||
*
|
||||
* **Use this if you are self-hosting Multi-Scrobbler on localhost or accessed like http://IP:PORT**
|
||||
*/
|
||||
appPassword?: string
|
||||
}
|
||||
|
||||
export interface TealClientData extends TealData, CommonClientData {
|
||||
|
||||
}
|
||||
export interface TealClientConfig extends CommonClientConfig {
|
||||
/**
|
||||
* Should always be `client` when using Tealfm as a client
|
||||
*
|
||||
* @default client
|
||||
* @examples ["client"]
|
||||
* */
|
||||
configureAs?: 'client' | 'source'
|
||||
data: TealClientData
|
||||
options?: TealClientOptions
|
||||
}
|
||||
|
||||
export interface TealOptions {
|
||||
}
|
||||
|
||||
|
||||
export interface TealClientOptions extends TealOptions,CommonClientOptions {
|
||||
|
||||
}
|
||||
|
||||
export interface TealClientAIOConfig extends TealClientConfig {
|
||||
type: 'tealfm'
|
||||
}
|
||||
|
||||
export interface ScrobbleRecord {
|
||||
$type: "fm.teal.alpha.feed.play",
|
||||
trackName: string,
|
||||
playedTime: string,
|
||||
duration?: number
|
||||
artists?: {artistName?: string, artistMbId?: string}[]
|
||||
/** Album name */
|
||||
releaseName?: string
|
||||
submissionClientAgent: string,
|
||||
musicServiceBaseDomain?: string
|
||||
// musicbrainz
|
||||
recordingMbId?: string
|
||||
releaseMbId?: string
|
||||
isrc?: string,
|
||||
[x: string]: unknown
|
||||
}
|
||||
|
||||
export interface ListRecord<T> {
|
||||
uri: string;
|
||||
cid: string;
|
||||
value: T;
|
||||
}
|
||||
export interface RecordOptions {
|
||||
web?: string;
|
||||
playId?: string;
|
||||
user?: string;
|
||||
}
|
||||
@@ -87,6 +87,15 @@ export interface JellyApiData extends CommonSourceData {
|
||||
* @default false
|
||||
*/
|
||||
allowUnknown?: boolean
|
||||
|
||||
/**
|
||||
* HOST:PORT of the Jellyfin server that your browser will be able to access from the frontend (and thus load images and links from)
|
||||
* If unspecified it will use the normal server HOST and PORT from the `url`
|
||||
* Necessary if you are using a reverse proxy or other network configuration that prevents the frontend from accessing the server directly
|
||||
*
|
||||
* ENV: JELLYFIN_FRONTEND_URL_OVERRIDE
|
||||
* */
|
||||
frontendUrlOverride?: string
|
||||
}
|
||||
|
||||
export interface JellyApiOptions extends CommonSourceOptions {
|
||||
|
||||
@@ -74,6 +74,16 @@ export interface PlexApiData extends CommonSourceData, PollingOptions {
|
||||
}
|
||||
|
||||
export interface PlexApiOptions extends CommonSourceOptions {
|
||||
/**
|
||||
* Ignore invalid cert errors when connecting to Plex
|
||||
*
|
||||
* Useful for Plex servers using "Required" Secure Connections with self-signed certificates
|
||||
*
|
||||
* Do not enable unless you know you need this.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ignoreInvalidCert?: boolean
|
||||
}
|
||||
|
||||
export interface PlexApiSourceConfig extends CommonSourceConfig {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { RockSkyData, RockSkyOptions } from "../client/rocksky.js";
|
||||
import { PollingOptions } from "../common.js";
|
||||
import { CommonSourceConfig, CommonSourceData, CommonSourceOptions } from "./index.js";
|
||||
|
||||
export interface RockskySourceData extends RockSkyData, CommonSourceData, PollingOptions {
|
||||
}
|
||||
|
||||
export interface RockskySourceOptions extends RockSkyOptions, CommonSourceOptions {
|
||||
|
||||
}
|
||||
|
||||
export interface RockskySourceConfig extends CommonSourceConfig {
|
||||
/**
|
||||
* When used in `rocksky.config` this tells multi-scrobbler whether to use this data to configure a source or client.
|
||||
*
|
||||
* @default source
|
||||
* @examples ["source"]
|
||||
* */
|
||||
configureAs?: 'source'
|
||||
data: RockskySourceData
|
||||
options?: RockskySourceOptions
|
||||
}
|
||||
|
||||
export interface RockskySourceAIOConfig extends RockskySourceConfig {
|
||||
type: 'rocksky'
|
||||
}
|
||||
@@ -23,6 +23,8 @@ import { YTMusicSourceAIOConfig, YTMusicSourceConfig } from "./ytmusic.js";
|
||||
import { IcecastSourceAIOConfig, IcecastSourceConfig } from "./icecast.js";
|
||||
import { KoitoSourceAIOConfig, KoitoSourceConfig } from "./koito.js";
|
||||
import { MalojaSourceAIOConfig, MalojaSourceConfig } from "./maloja.js";
|
||||
import { TealSourceAIOConfig, TealSourceConfig } from "./tealfm.js";
|
||||
import { RockskySourceAIOConfig, RockskySourceConfig } from "./rocksky.js";
|
||||
|
||||
|
||||
export type SourceConfig =
|
||||
@@ -53,7 +55,9 @@ export type SourceConfig =
|
||||
| VLCSourceConfig
|
||||
| IcecastSourceConfig
|
||||
| AzuracastSourceConfig
|
||||
| KoitoSourceConfig;
|
||||
| KoitoSourceConfig
|
||||
| TealSourceConfig
|
||||
| RockskySourceConfig;
|
||||
|
||||
export type SourceAIOConfig =
|
||||
SpotifySourceAIOConfig
|
||||
@@ -83,4 +87,6 @@ export type SourceAIOConfig =
|
||||
| VLCSourceAIOConfig
|
||||
| IcecastSourceAIOConfig
|
||||
| AzuracastSourceAIOConfig
|
||||
| KoitoSourceAIOConfig;
|
||||
| KoitoSourceAIOConfig
|
||||
| TealSourceAIOConfig
|
||||
| RockskySourceAIOConfig;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { TealData, TealOptions } from "../client/tealfm.js"
|
||||
import { PollingOptions } from "../common.js"
|
||||
import { CommonSourceConfig, CommonSourceData, CommonSourceOptions } from "./index.js"
|
||||
|
||||
|
||||
export interface TealSourceData extends TealData, CommonSourceData, PollingOptions {
|
||||
|
||||
}
|
||||
|
||||
export interface TealSourceConfig extends CommonSourceConfig {
|
||||
/**
|
||||
* Should always be `souce` when using Tealfm as a Source
|
||||
*
|
||||
* @default source
|
||||
* @examples ["source"]
|
||||
* */
|
||||
configureAs?: 'source'
|
||||
data: TealSourceData
|
||||
options?: TealSourceOptions
|
||||
}
|
||||
|
||||
export interface TealSourceOptions extends CommonSourceOptions, TealOptions {
|
||||
}
|
||||
|
||||
export interface TealSourceAIOConfig extends TealSourceConfig {
|
||||
type: 'tealfm'
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+107
-88
@@ -206,7 +206,7 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
|
||||
try {
|
||||
const resp = await this.getUserListens(maxTracks, user);
|
||||
return resp.listens.map(x => ListenbrainzApiClient.listenResponseToPlay(x));
|
||||
return resp.listens.map(x => listenResponseToPlay(x));
|
||||
} catch (e) {
|
||||
this.logger.error(`Error encountered while getting User listens | Error => ${e.message}`);
|
||||
return [];
|
||||
@@ -248,46 +248,52 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
static listenPayloadToPlay(payload: ListenPayload, nowPlaying: boolean = false): PlayObject {
|
||||
static submitToPlayObj(submitObj: SubmitPayload, playObj: PlayObject): PlayObject {
|
||||
if (submitObj.payload.length > 0) {
|
||||
const respPlay = {
|
||||
...playObj,
|
||||
};
|
||||
respPlay.data = {
|
||||
...playObj.data,
|
||||
album: submitObj.payload[0].track_metadata?.release_name ?? playObj.data.album,
|
||||
track: submitObj.payload[0].track_metadata?.track_name ?? playObj.data.album,
|
||||
};
|
||||
return respPlay;
|
||||
}
|
||||
return playObj;
|
||||
}
|
||||
|
||||
static formatPlayObj(obj: any, options: FormatPlayObjectOptions): PlayObject {
|
||||
return listenResponseToPlay(obj);
|
||||
}
|
||||
}
|
||||
|
||||
export const listenPayloadToPlay = (payload: ListenPayload, nowPlaying: boolean = false): PlayObject => {
|
||||
|
||||
const listened = payload.listened_at ?? dayjs().unix();
|
||||
const listenedAt = typeof listened === 'number' ? dayjs.unix(listened) : dayjs(listened);
|
||||
|
||||
const {
|
||||
listened_at = dayjs().unix(),
|
||||
track_metadata: {
|
||||
artist_name,
|
||||
track_name,
|
||||
release_name,
|
||||
additional_info: {
|
||||
duration,
|
||||
track_mbid,
|
||||
artist_mbids,
|
||||
release_mbid,
|
||||
release_group_mbid
|
||||
} = {}
|
||||
additional_info = {}
|
||||
} = {},
|
||||
} = payload;
|
||||
|
||||
return {
|
||||
data: {
|
||||
playDate: typeof listened_at === 'number' ? dayjs.unix(listened_at) : dayjs(listened_at),
|
||||
track: track_name,
|
||||
artists: [artist_name],
|
||||
album: release_name,
|
||||
duration,
|
||||
meta: {
|
||||
brainz: {
|
||||
artist: artist_mbids !== undefined ? artist_mbids : undefined,
|
||||
album: release_mbid,
|
||||
albumArtist: release_group_mbid,
|
||||
track: track_mbid
|
||||
}
|
||||
}
|
||||
},
|
||||
meta: {
|
||||
nowPlaying,
|
||||
}
|
||||
}
|
||||
const play = listenResponseToPlay({
|
||||
...payload,
|
||||
track_metadata: {
|
||||
...payload.track_metadata,
|
||||
additional_info,
|
||||
},
|
||||
listened_at: listenedAt.unix()
|
||||
});
|
||||
|
||||
play.meta.nowPlaying = nowPlaying;
|
||||
|
||||
return play;
|
||||
}
|
||||
|
||||
static listenResponseToPlay(listen: ListenResponse): PlayObject {
|
||||
export const listenResponseToPlay = (listen: ListenResponse): PlayObject => {
|
||||
const {
|
||||
listened_at,
|
||||
track_metadata: {
|
||||
@@ -300,13 +306,13 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
release_mbid
|
||||
} = {},
|
||||
additional_info: {
|
||||
release_artists_names = [],
|
||||
release_artist_names = [],
|
||||
release_group_mbid
|
||||
} = {}
|
||||
} = {}
|
||||
} = listen;
|
||||
|
||||
const naivePlay = ListenbrainzApiClient.listenResponseToNaivePlay(listen);
|
||||
const naivePlay = listenToNaivePlay(listen);
|
||||
|
||||
if(artistMappings.length === 0) {
|
||||
// if there are no artist mappings its likely MB doesn't have info on this track so just use our internally derived attempt
|
||||
@@ -527,7 +533,7 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
const primaryArtistMBMapping = artistMappings.find(x => x.artist_credit_name === primaryArtist);
|
||||
if(primaryArtistMBMapping !== undefined) {
|
||||
// only include as primary if musicbrainz does not disagree with us
|
||||
if(release_artists_names.length === 0 || (release_artists_names.length > 0 && release_artists_names.includes(primaryArtist))) {
|
||||
if(release_artist_names.length === 0 || (release_artist_names.length > 0 && release_artist_names.includes(primaryArtist))) {
|
||||
brainzMetaRaw.albumArtist = primaryArtistMBMapping.artist_mbid;
|
||||
}
|
||||
}
|
||||
@@ -552,10 +558,10 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
return play;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to parse true artists and track name without using MB information
|
||||
* */
|
||||
static listenResponseToNaivePlay(listen: ListenResponse): PlayObject {
|
||||
/**
|
||||
* Try to parse true artists and track name without using MB information
|
||||
* */
|
||||
export const listenToNaivePlay = (listen: ListenResponse): PlayObject => {
|
||||
const {
|
||||
listened_at,
|
||||
recording_msid,
|
||||
@@ -563,16 +569,21 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
track_name,
|
||||
artist_name,
|
||||
release_name,
|
||||
duration,
|
||||
additional_info: {
|
||||
recording_msid: aRecordingMsid,
|
||||
recording_mbid: aRecordingMbid,
|
||||
release_artist_name,
|
||||
release_artist_names = [],
|
||||
release_group_mbid,
|
||||
release_mbid,
|
||||
artist_mbids = [],
|
||||
duration: aDuration,
|
||||
duration_ms: aDurationMs,
|
||||
music_service_name,
|
||||
music_service,
|
||||
submission_client,
|
||||
submission_client_version
|
||||
submission_client_version,
|
||||
artist_names = [],
|
||||
} = {},
|
||||
mbid_mapping: {
|
||||
recording_mbid: mRecordingMbid
|
||||
@@ -583,30 +594,45 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
|
||||
const playId = recording_msid ?? aRecordingMsid;
|
||||
const trackId = aRecordingMbid ?? mRecordingMbid;
|
||||
let dur = duration ?? aDuration;
|
||||
let dur = aDuration;
|
||||
if (dur === undefined && aDurationMs !== undefined) {
|
||||
dur = Math.round(aDurationMs / 1000);
|
||||
}
|
||||
|
||||
let normalTrackName = track_name;
|
||||
let artists: string[] = [artist_name];
|
||||
let artists: string[] = [];
|
||||
|
||||
// since we aren't using MB mappings we should be conservative and assume artist string with & are proper names (not joiner)
|
||||
const parsedArtists = parseCredits(artist_name, [',', '/', '\\']);
|
||||
if (parsedArtists !== undefined) {
|
||||
if (parsedArtists.primary !== undefined) {
|
||||
artists.push(parsedArtists.primary);
|
||||
if(artist_names.length > 0) {
|
||||
artists = artist_names;
|
||||
} else {
|
||||
artists = [artist_name];
|
||||
|
||||
// since we aren't using MB mappings we should be conservative and assume artist string with & are proper names (not joiner)
|
||||
const parsedArtists = parseCredits(artist_name, [',', '/', '\\']);
|
||||
if (parsedArtists !== undefined) {
|
||||
if (parsedArtists.primary !== undefined) {
|
||||
artists.push(parsedArtists.primary);
|
||||
}
|
||||
artists = artists.concat(parsedArtists.secondary);
|
||||
}
|
||||
artists = artists.concat(parsedArtists.secondary);
|
||||
// use all delimiters when trying to find artists in track name
|
||||
const parsedTrackArtists = parseCredits(track_name);
|
||||
if (parsedTrackArtists !== undefined) {
|
||||
// if we found "ft. something" in track string then we now have a "real" track name and more artists
|
||||
normalTrackName = parsedTrackArtists.primary;
|
||||
artists = artists.concat(parsedTrackArtists.secondary)
|
||||
}
|
||||
artists = uniqueNormalizedStrArr(artists);
|
||||
}
|
||||
// use all delimiters when trying to find artists in track name
|
||||
const parsedTrackArtists = parseCredits(track_name);
|
||||
if (parsedTrackArtists !== undefined) {
|
||||
// if we found "ft. something" in track string then we now have a "real" track name and more artists
|
||||
normalTrackName = parsedTrackArtists.primary;
|
||||
artists = artists.concat(parsedTrackArtists.secondary)
|
||||
|
||||
let albumArtists: string[];
|
||||
if(release_artist_name !== undefined) {
|
||||
albumArtists = [release_artist_name];
|
||||
}
|
||||
artists = uniqueNormalizedStrArr(artists);
|
||||
if(release_artist_names.length > 0) {
|
||||
albumArtists = unique([...(albumArtists ?? []), ...release_artist_names])
|
||||
}
|
||||
|
||||
|
||||
const play: PlayObject = {
|
||||
data: {
|
||||
@@ -614,24 +640,35 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
track: normalTrackName,
|
||||
artists: artists,
|
||||
album: release_name,
|
||||
duration: dur
|
||||
albumArtists,
|
||||
duration: dur,
|
||||
meta: {
|
||||
}
|
||||
},
|
||||
meta: {
|
||||
source: 'listenbrainz',
|
||||
source: submission_client ?? 'listenbrainz',
|
||||
playId,
|
||||
deviceId: combinePartsToString([music_service_name ?? music_service, submission_client, submission_client_version])
|
||||
}
|
||||
}
|
||||
|
||||
const brainzMeta: BrainzMeta = {};
|
||||
if(Object.keys(additional_info).length > 0) {
|
||||
brainzMeta.additionalInfo = additional_info;
|
||||
if(trackId !== undefined) {
|
||||
play.meta.trackid = trackId;
|
||||
}
|
||||
|
||||
// we shouldn't include more metdata here because we don't know if the MB mapped data is actually correct
|
||||
if(trackId !== undefined) {
|
||||
brainzMeta.track = trackId;
|
||||
play.meta.trackid = trackId;
|
||||
const brainzMeta: BrainzMeta = removeUndefinedKeys({
|
||||
album: release_mbid,
|
||||
releaseGroup: release_group_mbid,
|
||||
track: trackId
|
||||
}) ?? {};
|
||||
|
||||
if(Object.keys(additional_info).length > 0) {
|
||||
brainzMeta.additionalInfo = additional_info;
|
||||
|
||||
}
|
||||
if(artist_mbids.filter(x => x.trim() !== "").length > 0) {
|
||||
brainzMeta.artist = artist_mbids.filter(x => x.trim() !== "");
|
||||
brainzMeta.additionalInfo.artist_mbids = brainzMeta.artist;
|
||||
}
|
||||
|
||||
if(Object.keys(brainzMeta).length > 0) {
|
||||
@@ -643,26 +680,6 @@ export class ListenbrainzApiClient extends AbstractApiClient {
|
||||
return play;
|
||||
}
|
||||
|
||||
static submitToPlayObj(submitObj: SubmitPayload, playObj: PlayObject): PlayObject {
|
||||
if (submitObj.payload.length > 0) {
|
||||
const respPlay = {
|
||||
...playObj,
|
||||
};
|
||||
respPlay.data = {
|
||||
...playObj.data,
|
||||
album: submitObj.payload[0].track_metadata?.release_name ?? playObj.data.album,
|
||||
track: submitObj.payload[0].track_metadata?.track_name ?? playObj.data.album,
|
||||
};
|
||||
return respPlay;
|
||||
}
|
||||
return playObj;
|
||||
}
|
||||
|
||||
static formatPlayObj(obj: any, options: FormatPlayObjectOptions): PlayObject {
|
||||
return ListenbrainzApiClient.listenResponseToPlay(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const playToListenPayload = (play: PlayObject): ListenPayload => {
|
||||
const {
|
||||
@@ -684,6 +701,7 @@ export const playToListenPayload = (play: PlayObject): ListenPayload => {
|
||||
mediaPlayerName,
|
||||
mediaPlayerVersion,
|
||||
musicService,
|
||||
source
|
||||
}
|
||||
} = play;
|
||||
// using submit-listens exmaple from openapi https://rain0r.github.io/listenbrainz-openapi/index.html#/lbCore/submitListens
|
||||
@@ -702,6 +720,7 @@ export const playToListenPayload = (play: PlayObject): ListenPayload => {
|
||||
media_player: mediaPlayerName ?? msAdditionalInfo.media_player,
|
||||
media_player_version: mediaPlayerVersion ?? msAdditionalInfo.media_player_version,
|
||||
music_service: musicService !== undefined ? musicServiceToCononical(musicService) : msAdditionalInfo.music_service,
|
||||
music_service_name: source,
|
||||
spotify_id: spotify.track ?? msAdditionalInfo.spotify_id,
|
||||
spotify_album_id: spotify.album ?? msAdditionalInfo.spotify_album_id,
|
||||
spotify_artist_ids: spotify.artist ?? msAdditionalInfo.spotify_artist_ids
|
||||
@@ -759,7 +778,7 @@ const musicServices = {
|
||||
* Converts MS musicService to LZ cononical Music Service Name, if one exists
|
||||
* @see https://listenbrainz.readthedocs.io/en/latest/users/json.html#payload-json-details
|
||||
* */
|
||||
const musicServiceToCononical = (str: string): string | undefined => {
|
||||
export const musicServiceToCononical = (str: string): string | undefined => {
|
||||
const lower = str.trim().toLocaleLowerCase();
|
||||
for(const [k, v] of Object.entries(musicServices)) {
|
||||
if(lower.includes(k)) {
|
||||
|
||||
+288
@@ -0,0 +1,288 @@
|
||||
import dayjs from "dayjs";
|
||||
import request, { Request, Response } from 'superagent';
|
||||
import { PlayObject, URLData } from "../../../core/Atomic.js";
|
||||
import { nonEmptyStringOrDefault } from "../../../core/StringUtils.js";
|
||||
import { UpstreamError } from "../errors/UpstreamError.js";
|
||||
import { AbstractApiOptions, DEFAULT_RETRY_MULTIPLIER, FormatPlayObjectOptions } from "../infrastructure/Atomic.js";
|
||||
import { RockSkyClientData, RockSkyData, RockSkyOptions } from "../infrastructure/config/client/rocksky.js";
|
||||
import AbstractApiClient from "./AbstractApiClient.js";
|
||||
import { isPortReachableConnect, joinedUrl, normalizeWebAddress } from '../../utils/NetworkUtils.js';
|
||||
import { unique } from '../../utils.js';
|
||||
import { ListenPayload, ListenResponse, ListenType, SubmitPayload } from './listenbrainz/interfaces.js';
|
||||
import { playToListenPayload } from './ListenbrainzApiClient.js';
|
||||
import { RockskyScrobble } from './rocksky/interfaces.js';
|
||||
import { Handle } from "@atcute/lexicons";
|
||||
import { identifierToAtProtoHandle } from './bluesky/bsUtils.js';
|
||||
|
||||
interface SubmitOptions {
|
||||
log?: boolean
|
||||
listenType?: ListenType
|
||||
}
|
||||
|
||||
export interface ListensResponse {
|
||||
count: number;
|
||||
listens: ListenResponse[];
|
||||
}
|
||||
|
||||
export interface SubmitResponse {
|
||||
payload?: {
|
||||
ignored_listens: number
|
||||
submitted_listens: number
|
||||
},
|
||||
status: string
|
||||
}
|
||||
|
||||
export class RockSkyApiClient extends AbstractApiClient {
|
||||
|
||||
declare config: RockSkyClientData;
|
||||
lzUrl: URLData;
|
||||
apiUrl: URLData;
|
||||
isKoito: boolean = false;
|
||||
handle: Handle;
|
||||
|
||||
constructor(name: any, config: RockSkyData & RockSkyOptions, options: AbstractApiOptions) {
|
||||
super('RockSky', name, config, options);
|
||||
const {
|
||||
audioScrobblerUrl,
|
||||
apiUrl
|
||||
} = config;
|
||||
|
||||
this.lzUrl = normalizeWebAddress(audioScrobblerUrl ?? 'https://audioscrobbler.rocksky.app/');
|
||||
this.apiUrl = normalizeWebAddress(apiUrl ?? 'https://api.rocksky.app/xrpc/');
|
||||
|
||||
this.logger.verbose(`Audioscrobbler URL: '${audioScrobblerUrl ?? '(None Given)'}' => Normalized: '${this.lzUrl.url}'`);
|
||||
this.logger.verbose(`API URL: '${apiUrl ?? '(None Given)'}' => Normalized: '${this.apiUrl.url}'`);
|
||||
this.handle = identifierToAtProtoHandle(this.config.handle, {logger: this.logger, defaultDomain: 'bsky.social'});
|
||||
}
|
||||
|
||||
|
||||
callLZApi = async <T = Response>(req: Request, retries = 0): Promise<T> => {
|
||||
try {
|
||||
req.set('Authorization', `Token ${this.config.token}`);
|
||||
return await req as T;
|
||||
} catch (e) {
|
||||
const {
|
||||
message,
|
||||
err,
|
||||
status,
|
||||
response: {
|
||||
body = undefined,
|
||||
text = undefined,
|
||||
} = {}
|
||||
} = e;
|
||||
// TODO check err for network exception
|
||||
if(status !== undefined) {
|
||||
const msgParts = [`(HTTP Status ${status})`];
|
||||
// if the response is 400 then its likely there was an issue with the data we sent rather than an error with the service
|
||||
const showStopper = status !== 400;
|
||||
if(body !== undefined) {
|
||||
if(typeof body === 'object') {
|
||||
if('code' in body) {
|
||||
msgParts.push(`Code ${body.code}`);
|
||||
}
|
||||
if('error' in body) {
|
||||
msgParts.push(`Error => ${body.error}`);
|
||||
}
|
||||
if('message' in body) {
|
||||
msgParts.push(`Message => ${body.error}`);
|
||||
}
|
||||
// if('track_metadata' in body) {
|
||||
// msgParts.push(`Track Metadata => ${JSON.stringify(body.track_metadata)}`);
|
||||
// }
|
||||
} else if(typeof body === 'string') {
|
||||
msgParts.push(`Response => ${body}`);
|
||||
}
|
||||
} else if (text !== undefined) {
|
||||
msgParts.push(`Response => ${text}`);
|
||||
}
|
||||
throw new UpstreamError(`Listenbrainz API Request Failed => ${msgParts.join(' | ')}`, {cause: e, showStopper});
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
callApi = async <T = Response>(req: Request, retries = 0): Promise<T> => {
|
||||
const {
|
||||
maxRequestRetries = 2,
|
||||
retryMultiplier = DEFAULT_RETRY_MULTIPLIER
|
||||
} = this.config;
|
||||
|
||||
try {
|
||||
return await req as T;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
testConnection = async () => {
|
||||
try {
|
||||
await isPortReachableConnect(this.apiUrl.port, {host: this.apiUrl.url.hostname});
|
||||
} catch (e) {
|
||||
throw new Error('Could not reach API URL endpoint', {cause: e});
|
||||
}
|
||||
try {
|
||||
await isPortReachableConnect(this.lzUrl.port, {host: this.lzUrl.url.hostname});
|
||||
} catch (e) {
|
||||
throw new Error('Could not reach Audioscrobbler URL endpoint', {cause: e});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
testAuth = async () => {
|
||||
try {
|
||||
const resp = await this.callApi(request.get(`${joinedUrl(this.lzUrl.url,'1/validate-token')}`));
|
||||
return true;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
getUserListens = async (maxTracks: number, user?: string): Promise<UserScrobbleResponse> => {
|
||||
try {
|
||||
|
||||
const resp = await this.callApi(request
|
||||
.get(`${joinedUrl(this.apiUrl.url,`app.rocksky.actor.getActorScrobbles`)}`)
|
||||
// this endpoint can take forever, sometimes, and we want to make sure we timeout in a reasonable amount of time for polling sources to continue trying to scrobble
|
||||
.timeout({
|
||||
response: 3000, // wait 3 seconds before timeout if server doesn't response at all
|
||||
deadline: 5000 // wait 5 seconds overall for request to complete
|
||||
})
|
||||
.query({
|
||||
limit: maxTracks,
|
||||
offset: 0,
|
||||
did: user ?? this.config.handle
|
||||
})
|
||||
.redirects(1));
|
||||
return resp.body as UserScrobbleResponse;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
getRecentlyPlayed = async (maxTracks: number, user?: string): Promise<PlayObject[]> => {
|
||||
try {
|
||||
const resp = await this.getUserListens(maxTracks, user);
|
||||
return resp.scrobbles.map(x => rockskyScrobbleToPlay(x));
|
||||
} catch (e) {
|
||||
this.logger.error(`Error encountered while getting User listens | Error => ${e.message}`);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
submitListen = async (play: PlayObject, options: SubmitOptions = {}) => {
|
||||
const { log = false, listenType = 'single'} = options;
|
||||
try {
|
||||
const listenPayload: SubmitPayload = {listen_type: listenType, payload: [playToListenPayload(play)]};
|
||||
if(listenType === 'playing_now') {
|
||||
delete listenPayload.payload[0].listened_at;
|
||||
}
|
||||
if(log) {
|
||||
this.logger.debug(`Submit Payload: ${JSON.stringify(listenPayload)}`);
|
||||
}
|
||||
// response consists of {"status": "ok"}
|
||||
// so no useful information
|
||||
// https://listenbrainz.readthedocs.io/en/latest/users/api-usage.html#submitting-listens
|
||||
// TODO may we should make a call to recent-listens to get the parsed scrobble?
|
||||
const resp = await this.callLZApi(request.post(`${joinedUrl(this.lzUrl.url,'1/submit-listens')}`).type('json').send(listenPayload));
|
||||
if(log) {
|
||||
this.logger.debug(`Submit Response: ${resp.text}`)
|
||||
}
|
||||
return resp.body as SubmitResponse;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
static listenPayloadToPlay(payload: ListenPayload, nowPlaying: boolean = false): PlayObject {
|
||||
const {
|
||||
listened_at = dayjs().unix(),
|
||||
track_metadata: {
|
||||
artist_name,
|
||||
track_name,
|
||||
release_name,
|
||||
additional_info: {
|
||||
duration,
|
||||
track_mbid,
|
||||
artist_mbids,
|
||||
artist_names = [],
|
||||
release_mbid,
|
||||
release_group_mbid,
|
||||
release_artist_name,
|
||||
release_artist_names = []
|
||||
} = {}
|
||||
} = {},
|
||||
} = payload;
|
||||
|
||||
let albumArtists: string[];
|
||||
if(release_artist_name !== undefined) {
|
||||
albumArtists = [release_artist_name];
|
||||
}
|
||||
if(release_artist_names.length > 0) {
|
||||
albumArtists = unique([...(albumArtists ?? []), ...release_artist_names])
|
||||
}
|
||||
|
||||
return {
|
||||
data: {
|
||||
playDate: typeof listened_at === 'number' ? dayjs.unix(listened_at) : dayjs(listened_at),
|
||||
track: track_name,
|
||||
artists: unique([artist_name, ...artist_names]),
|
||||
albumArtists,
|
||||
album: release_name,
|
||||
duration,
|
||||
meta: {
|
||||
brainz: {
|
||||
artist: artist_mbids !== undefined ? artist_mbids : undefined,
|
||||
album: release_mbid,
|
||||
albumArtist: release_group_mbid,
|
||||
track: track_mbid
|
||||
}
|
||||
}
|
||||
},
|
||||
meta: {
|
||||
nowPlaying,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static submitToPlayObj(submitObj: SubmitPayload, playObj: PlayObject): PlayObject {
|
||||
if (submitObj.payload.length > 0) {
|
||||
const respPlay = {
|
||||
...playObj,
|
||||
};
|
||||
respPlay.data = {
|
||||
...playObj.data,
|
||||
album: submitObj.payload[0].track_metadata?.release_name ?? playObj.data.album,
|
||||
track: submitObj.payload[0].track_metadata?.track_name ?? playObj.data.album,
|
||||
};
|
||||
return respPlay;
|
||||
}
|
||||
return playObj;
|
||||
}
|
||||
|
||||
static formatPlayObj(obj: any, options: FormatPlayObjectOptions): PlayObject {
|
||||
return rockskyScrobbleToPlay(obj);
|
||||
}
|
||||
}
|
||||
|
||||
interface UserScrobbleResponse {
|
||||
scrobbles: RockskyScrobble[]
|
||||
}
|
||||
|
||||
export const rockskyScrobbleToPlay = (obj: RockskyScrobble): PlayObject => {
|
||||
const play: PlayObject = {
|
||||
data: {
|
||||
track: obj.title,
|
||||
artists: nonEmptyStringOrDefault(obj.artist) ? [obj.artist] : [],
|
||||
albumArtists: nonEmptyStringOrDefault(obj.albumArtist) ? [obj.albumArtist] : [],
|
||||
album: nonEmptyStringOrDefault(obj.album),
|
||||
playDate: dayjs.utc(obj.createdAt).local()
|
||||
},
|
||||
meta: {
|
||||
trackId: obj.trackId,
|
||||
playId: obj.id
|
||||
}
|
||||
};
|
||||
|
||||
return play;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
import { getRoot } from "../../../ioc.js";
|
||||
import { AbstractApiOptions } from "../../infrastructure/Atomic.js";
|
||||
import { ListRecord, ScrobbleRecord, TealClientData } from "../../infrastructure/config/client/tealfm.js";
|
||||
import AbstractApiClient from "../AbstractApiClient.js";
|
||||
import { Agent } from "@atproto/api";
|
||||
import { MSCache } from "../../Cache.js";
|
||||
import { PlayObject } from "../../../../core/Atomic.js";
|
||||
import { musicServiceToCononical } from "../ListenbrainzApiClient.js";
|
||||
import { parseRegexSingle } from "@foxxmd/regex-buddy-core";
|
||||
import { RecordOptions } from "../../infrastructure/config/client/tealfm.js";
|
||||
import dayjs from "dayjs";
|
||||
import { getScrobbleTsSOCDateWithContext } from "../../../utils/TimeUtils.js";
|
||||
|
||||
|
||||
export abstract class AbstractBlueSkyApiClient extends AbstractApiClient {
|
||||
|
||||
declare config: TealClientData;
|
||||
|
||||
agent!: Agent;
|
||||
|
||||
cache: MSCache;
|
||||
|
||||
constructor(name: any, config: TealClientData, options: AbstractApiOptions) {
|
||||
super('blueSky', name, config, options);
|
||||
|
||||
this.cache = getRoot().items.cache();
|
||||
}
|
||||
|
||||
abstract initClient(): Promise<void>;
|
||||
|
||||
abstract restoreSession(): Promise<boolean>;
|
||||
|
||||
async createScrobbleRecord(record: ScrobbleRecord): Promise<void> {
|
||||
try {
|
||||
await this.agent.com.atproto.repo.createRecord({
|
||||
repo: this.agent.sessionManager.did,
|
||||
collection: "fm.teal.alpha.feed.play",
|
||||
record
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error(`Failed to create record`, { cause: e });
|
||||
}
|
||||
}
|
||||
|
||||
async listScrobbleRecord(limit: number = 20): Promise<ListRecord<ScrobbleRecord>[]> {
|
||||
try {
|
||||
const response = await this.agent.com.atproto.repo.listRecords({
|
||||
repo: this.agent.sessionManager.did,
|
||||
collection: "fm.teal.alpha.feed.play",
|
||||
limit
|
||||
});
|
||||
return response.data.records as unknown as ListRecord<ScrobbleRecord>[];
|
||||
} catch (e) {
|
||||
throw new Error(`Failed to create record`, { cause: e });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const playToRecord = (play: PlayObject): ScrobbleRecord => {
|
||||
|
||||
const record: ScrobbleRecord = {
|
||||
$type: "fm.teal.alpha.feed.play",
|
||||
trackName: play.data.track,
|
||||
artists: play.data.artists.map(x => ({ artistName: x })),
|
||||
duration: play.data.duration,
|
||||
playedTime: getScrobbleTsSOCDateWithContext(play)[0].toISOString(),
|
||||
releaseName: play.data.album,
|
||||
submissionClientAgent: `multi-scrobbler/${getRoot().items.version}`,
|
||||
musicServiceBaseDomain: play.meta.musicService !== undefined ? musicServiceToCononical(play.meta.musicService) : undefined,
|
||||
recordingMbId: play.data.meta?.brainz?.track,
|
||||
releaseMbId: play.data.meta?.brainz?.album
|
||||
};
|
||||
|
||||
return record;
|
||||
};export const listRecordToPlay = (listRecord: ListRecord<ScrobbleRecord>): PlayObject => {
|
||||
const opts: RecordOptions = {};
|
||||
const uriRes = parseRegexSingle(ATPROTO_URI_REGEX, listRecord.uri);
|
||||
if (uriRes !== undefined) {
|
||||
opts.web = `https://atproto.at/viewer?uri=${uriRes.named.resource}`;
|
||||
opts.playId = uriRes.named.tid;
|
||||
opts.user = uriRes.named.did;
|
||||
}
|
||||
return recordToPlay(listRecord.value, opts);
|
||||
};
|
||||
export const recordToPlay = (record: ScrobbleRecord, options: RecordOptions = {}): PlayObject => {
|
||||
|
||||
const play: PlayObject = {
|
||||
data: {
|
||||
track: record.trackName,
|
||||
artists: record.artists.filter(x => x.artistName !== undefined).map(x => x.artistName),
|
||||
duration: record.duration,
|
||||
playDate: dayjs(record.playedTime),
|
||||
album: record.releaseName,
|
||||
meta: {
|
||||
brainz: {
|
||||
track: record.recordingMbId,
|
||||
album: record.releaseMbId,
|
||||
artist: record.artists.filter(x => x.artistMbId !== undefined).map(x => x.artistMbId)
|
||||
}
|
||||
}
|
||||
},
|
||||
meta: {
|
||||
source: 'tealfm',
|
||||
parsedFrom: 'history',
|
||||
playId: options.playId,
|
||||
url: {
|
||||
web: options.web
|
||||
},
|
||||
user: options.user
|
||||
}
|
||||
};
|
||||
|
||||
return play;
|
||||
};
|
||||
export const ATPROTO_URI_REGEX = new RegExp(/at:\/\/(?<resource>(?<did>did.*?)\/fm.teal.alpha.feed.play\/(?<tid>.*))/);
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
import { AbstractApiOptions } from "../../infrastructure/Atomic.js";
|
||||
import { TealClientData } from "../../infrastructure/config/client/tealfm.js";
|
||||
import { Agent, CredentialSession, AtpSessionEvent, AtpSessionData } from "@atproto/api";
|
||||
import { AbstractBlueSkyApiClient } from "./AbstractBlueSkyApiClient.js";
|
||||
import { isPortReachableConnect, normalizeWebAddress } from "../../../utils/NetworkUtils.js";
|
||||
import { URLData } from "../../../../core/Atomic.js";
|
||||
import { isNodeNetworkException } from "../../errors/NodeErrors.js";
|
||||
import {
|
||||
CompositeDidDocumentResolver,
|
||||
CompositeHandleResolver,
|
||||
DohJsonHandleResolver,
|
||||
PlcDidDocumentResolver,
|
||||
WebDidDocumentResolver,
|
||||
WellKnownHandleResolver,
|
||||
} from "@atcute/identity-resolver";
|
||||
import { AtprotoDid, DidDocument } from "@atproto/oauth-client-node";
|
||||
import { identifierToAtProtoHandle } from "./bsUtils.js";
|
||||
|
||||
interface HandleData {
|
||||
did: string
|
||||
pds: string
|
||||
}
|
||||
|
||||
export class BlueSkyAppApiClient extends AbstractBlueSkyApiClient {
|
||||
|
||||
declare config: TealClientData;
|
||||
appSession?: CredentialSession;
|
||||
appPwAuth: boolean
|
||||
|
||||
|
||||
constructor(name: any, config: TealClientData, options: AbstractApiOptions) {
|
||||
super(name, config, options);
|
||||
this.logger.verbose(`Using App Password auth for session`);
|
||||
this.config.identifier = identifierToAtProtoHandle(this.config.identifier, {logger: this.logger, defaultDomain: 'bsky.social'});
|
||||
}
|
||||
|
||||
async initClient(): Promise<void> {
|
||||
const hd = await this.getATProtoIdentifier();
|
||||
this.logger.verbose(`Using ${hd.did} on PDS ${hd.pds}`);
|
||||
this.appSession = new CredentialSession(new URL(hd.pds), undefined, (evt: AtpSessionEvent, sess?: AtpSessionData) => {
|
||||
this.cache.cacheAuth.set(`appPwSession-${this.name}-${hd.did}`, sess, '1000h');
|
||||
});
|
||||
this.agent = new Agent(this.appSession);
|
||||
}
|
||||
|
||||
protected async getATProtoIdentifier(): Promise<HandleData> {
|
||||
|
||||
let hd: HandleData;
|
||||
hd = await this.cache.cacheAuth.get<HandleData>(`${this.name}-handleData`);
|
||||
if (hd !== undefined) {
|
||||
this.logger.debug('Found cached handle data');
|
||||
return hd;
|
||||
} else {
|
||||
this.logger.debug('Handle data not cached, attempting to resolve...');
|
||||
}
|
||||
|
||||
const handleResolver = new CompositeHandleResolver({
|
||||
strategy: "race",
|
||||
methods: {
|
||||
dns: new DohJsonHandleResolver({
|
||||
dohUrl: "https://mozilla.cloudflare-dns.com/dns-query",
|
||||
}),
|
||||
http: new WellKnownHandleResolver(),
|
||||
},
|
||||
});
|
||||
|
||||
let did: AtprotoDid;
|
||||
try {
|
||||
did = await handleResolver.resolve(this.config.identifier as `${string}.${string}`);
|
||||
this.logger.debug(`Resolved ${did}`);
|
||||
} catch (e) {
|
||||
throw new Error('Unable to resolve handle', { cause: e });
|
||||
}
|
||||
|
||||
const docResolver = new CompositeDidDocumentResolver({
|
||||
methods: {
|
||||
plc: new PlcDidDocumentResolver(),
|
||||
web: new WebDidDocumentResolver(),
|
||||
},
|
||||
});
|
||||
|
||||
let doc: Awaited<ReturnType<typeof docResolver.resolve>>;
|
||||
try {
|
||||
doc = await docResolver.resolve(did);
|
||||
} catch (e) {
|
||||
throw new Error('Unable to resolve did document', { cause: e });
|
||||
}
|
||||
if (doc.service === undefined || doc.service.length === 0) {
|
||||
throw new Error('did document did not return a service');
|
||||
}
|
||||
|
||||
if (typeof doc.service[0].serviceEndpoint !== 'string') {
|
||||
throw new Error(`Do not know how to handle this serviceEndpoint data structure!\n${JSON.stringify(doc.service[0].serviceEndpoint)}`);
|
||||
}
|
||||
hd = { did, pds: doc.service[0].serviceEndpoint };
|
||||
|
||||
this.cache.cacheAuth.set(`${this.name}-handleData`, hd, '1d');
|
||||
return hd;
|
||||
}
|
||||
|
||||
restoreSession = async (): Promise<boolean> => {
|
||||
const hd = await this.getATProtoIdentifier();
|
||||
const savedSession = await this.cache.cacheAuth.get<AtpSessionData>(`appPwSession-${this.name}-${hd.did}`);
|
||||
if (savedSession !== undefined) {
|
||||
try {
|
||||
this.logger.debug('Found existing session, trying to resume...');
|
||||
await this.appSession.resumeSession(savedSession);
|
||||
this.logger.debug('Resumed session!');
|
||||
return true;
|
||||
} catch (e) {
|
||||
this.logger.warn(new Error('Could not resume app password session from data', { cause: e }));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.logger.debug('No app password session data to restore');
|
||||
}
|
||||
|
||||
appLogin = async (): Promise<boolean> => {
|
||||
try {
|
||||
|
||||
const f = await this.appSession.login({
|
||||
identifier: this.config.identifier,
|
||||
password: this.config.appPassword
|
||||
});
|
||||
if (!f.success) {
|
||||
this.logger.error('Login was not successful with app password');
|
||||
return false;
|
||||
}
|
||||
this.logger.debug('Logged in.');
|
||||
return true;
|
||||
} catch (e) {
|
||||
this.logger.error(new Error('Could not login using app password', { cause: e }));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async checkPds(): Promise<true> {
|
||||
let hd: HandleData;
|
||||
try {
|
||||
hd = await this.getATProtoIdentifier();
|
||||
} catch(e) {
|
||||
throw new Error('Unable to get handle data', {cause: e});
|
||||
}
|
||||
|
||||
const normal = normalizeWebAddress(hd.pds);
|
||||
|
||||
try {
|
||||
await isPortReachableConnect(normal.port, {host: normal.url.hostname});
|
||||
return true;
|
||||
} catch (e) {
|
||||
if(isNodeNetworkException(e)) {
|
||||
throw new Error('Could not communicate with PDS server', {cause: e});
|
||||
}
|
||||
throw new Error('Unexpected error when trying to communicate with PDS server', {cause: e});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
import { AbstractApiOptions } from "../../infrastructure/Atomic.js";
|
||||
import { TealClientData } from "../../infrastructure/config/client/tealfm.js";
|
||||
import {
|
||||
NodeOAuthClient,
|
||||
NodeSavedStateStore,
|
||||
NodeSavedSessionStore,
|
||||
type OAuthClientMetadataInput,
|
||||
OAuthSession,
|
||||
} from "@atproto/oauth-client-node";
|
||||
import { Agent } from "@atproto/api";
|
||||
import { AbstractBlueSkyApiClient } from "./AbstractBlueSkyApiClient.js";
|
||||
|
||||
|
||||
export class BlueSkyOauthApiClient extends AbstractBlueSkyApiClient {
|
||||
|
||||
declare config: TealClientData;
|
||||
|
||||
oauthClient?: NodeOAuthClient;
|
||||
oauthSession: OAuthSession;
|
||||
|
||||
|
||||
constructor(name: any, config: TealClientData, options: AbstractApiOptions) {
|
||||
super(name, config, options);
|
||||
this.logger.verbose('Will use oauth for session');
|
||||
}
|
||||
|
||||
initClient = async () => {
|
||||
const sessionStore: NodeSavedSessionStore = {
|
||||
set: (k: string, state) => this.cache.cacheAuth.set(`session-${this.name}-${k}`, state).then(() => null),
|
||||
get: (k: string) => this.cache.cacheAuth.get(`session-${this.name}-${k}`),
|
||||
del: (k: string) => this.cache.cacheAuth.delete(`session-${this.name}-${k}`).then(() => null)
|
||||
}
|
||||
|
||||
const stateStore: NodeSavedStateStore = {
|
||||
set: (k: string, state) => this.cache.cacheAuth.set(`state-${this.name}-${k}`, state).then(() => null),
|
||||
get: (k: string) => this.cache.cacheAuth.get(`state-${this.name}-${k}`),
|
||||
del: (k: string) => this.cache.cacheAuth.delete(`state-${this.name}-${k}`).then(() => null)
|
||||
}
|
||||
|
||||
try {
|
||||
this.oauthClient = new NodeOAuthClient({
|
||||
clientMetadata: this.getMetadata(),
|
||||
stateStore,
|
||||
sessionStore
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error('Could not build oauth client', { cause: e });
|
||||
}
|
||||
}
|
||||
|
||||
restoreSession = async (): Promise<boolean> => {
|
||||
const did = await this.cache.cacheAuth.get<string>(`did-${this.name}`);
|
||||
if (did === undefined) {
|
||||
this.logger.debug('No did has been stored yet');
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
this.oauthSession = await this.oauthClient.restore(did);
|
||||
return true;
|
||||
} catch (e) {
|
||||
this.logger.warn(new Error('Could not restore oauth session', { cause: e }));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
createAuthorizeUrl = async (handle: string) => {
|
||||
const url = await this.oauthClient.authorize(handle.replace('@', ''));
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
handleCallback = async (params: URLSearchParams): Promise<boolean> => {
|
||||
const { session } = await this.oauthClient.callback(params);
|
||||
this.oauthSession = session;
|
||||
this.agent = new Agent(session);
|
||||
await this.cache.cacheAuth.set(`did-${this.name}`, session.did);
|
||||
return true;
|
||||
}
|
||||
|
||||
getMetadata() {
|
||||
return generateMetadata(this.name, this.config.baseUri);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const generateMetadata = (name, baseUrl): OAuthClientMetadataInput => {
|
||||
return {
|
||||
client_name: name,
|
||||
client_id: `${baseUrl}/client-metadata.json`,
|
||||
client_uri: `${baseUrl}`,
|
||||
redirect_uris: [`${baseUrl}/oauth/callback`],
|
||||
policy_uri: `${baseUrl}/policy`,
|
||||
tos_uri: `${baseUrl}/tos`,
|
||||
scope: "atproto transition:generic",
|
||||
grant_types: ["authorization_code", "refresh_token"],
|
||||
response_types: ["code"],
|
||||
application_type: "web",
|
||||
token_endpoint_auth_method: "none",
|
||||
dpop_bound_access_tokens: true,
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user