Skip to content

Commit e80ad81

Browse files
committedAug 28, 2024·
Merge branch 'develop'
2 parents 0fed96f + a396042 commit e80ad81

File tree

6 files changed

+41
-20
lines changed

6 files changed

+41
-20
lines changed
 

‎docsite/docs/FAQ.md

+20
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ EX `http://localhost:9078/lastfm/callback` -> `http://192.168.0.220:9078/lastfm/
128128

129129
Deezer has discontinued support for their API and the Deezer Source is now [**deprecated.**](configuration/configuration.mdx#deezer) See [this issue for more discussion.](https://github.com/FoxxMD/multi-scrobbler/issues/175#issuecomment-2296776625)
130130

131+
### Youtube Music fails after some time
132+
133+
The Youtube Music library relies on scraping the YTM site (pretending to be a browser) by using cookies/auth from your actual 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.
134+
135+
If you see errors in multi-scrobbler for YTM that contain **401** or **403** like
136+
137+
```
138+
Error: Could not send the specified request to browse. Status code: 401
139+
```
140+
141+
then YTM has invalidated your access. [Follow the YTM instructions to retrieve a new set of cookies for multi-scrobbler]((configuration/configuration.mdx#youtube-music)) and then restart MS to potentially resolve the problem. See [this issue](https://github.com/FoxxMD/multi-scrobbler/issues/158) for further discussion of the problem.
142+
131143
## Configuration Issues
132144

133145
### Config could not be parsed
@@ -181,3 +193,11 @@ Refer to [Force Media Tracking](configuration/configuration.mdx#forcing-media-tr
181193
### VLC is not scrobbling fields correctly
182194

183195
Before reporting an issue turn on metadata logging in the MS VLC configuration, [see the VLC documentation.](configuration/configuration.mdx#vlc-information-reporting)
196+
197+
### Youtube Music misses scrobbles
198+
199+
In order for multi-scrobbler to accurately determine if a song has been scrobbled it needs **a source of truth.** For YTM this is a "history" list scraped from the YTM website. Unfortunately, the data in this list can be (often) inconsistent which makes it hard for multi-scrobbler to "trust" that it is correct and determine when/if new scrobbles occur. This inconsistency is not something multi-scrobbler can control -- it is a side-effect of having to use an unofficial method to access YTM (scraping).
200+
201+
In order to compensate for this multi-scrobbler resets when it considers this list the "source of truth" based on if the list changes in an inconsistent way between consecutive checks. New scrobbles can only be detected when this list is "OK" as a source of truth for N+1 checks. Therefore, any new tracks that appear when the list is inconsistent will be ignored.
202+
203+
See [this issue](https://github.com/FoxxMD/multi-scrobbler/issues/156#issuecomment-2312533486) for further discussion and a more detailed explanation of why this is happening and how multi-scrobbler compensates for it.

‎docsite/docs/configuration/configuration.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,9 @@ After starting multi-scrobbler with credentials in-place open the dashboard (`ht
563563

564564
:::note
565565

566-
* YT Music authentication is "browser based" which means your credentials may expire after a (long?) period of time OR if you log out of https://music.youtube.com. In the event this happens just repeat the steps below to get new credentials.
566+
* YT Music authentication is "browser based" which means your credentials may expire after a (long?) period of time OR if you log out of https://music.youtube.com. In the event this happens just repeat the steps below to get new credentials. [See the FAQ](../FAQ.md#youtube-music-fails-after-some-time) for a more detailed explanation.
567567
* Communication to 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.
568+
* Due to this scrobble history from YTM is often inconsistent and can cause missed scrobbles. [See the FAQ](../FAQ.md#youtube-music-misses-scrobbles) for a more detailed explanation.
568569

569570
:::
570571

‎flatpak/io.github.foxxmd.multiscrobbler.metainfo.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ul>
2323
<li>Spotify</li>
2424
<li>Plex (Tautulli)</li>
25-
<li>Any subsonic-based music player (Airsonic)</li>
25+
<li>Any subsonic-based music player (Airsonic or Navidrome)</li>
2626
<li>Jellyfin</li>
2727
<li>WebScrobbler</li>
2828
<li>Mopidy</li>
@@ -33,6 +33,8 @@
3333
<li>MPRIS (linux desktop)</li>
3434
<li>Google Cast (Chromecast)</li>
3535
<li>Musikcube</li>
36+
<li>MPDF (Music Player Daemon)</li>
37+
<li>VLC</li>
3638
</ul>
3739
<p>and consolidate your listens (scrobbles) into one or more scrobbling servers/services:</p>
3840
<ul>
@@ -49,6 +51,7 @@
4951
</screenshot>
5052
</screenshots>
5153
<releases>
54+
<release version="0.8.3" date="2024-08-28"/>
5255
<release version="0.8.2" date="2024-08-20"/>
5356
<release version="0.8.1" date="2024-07-17"/>
5457
<release version="0.8.0" date="2024-07-08"/>

‎package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "multi-scrobbler",
3-
"version": "0.8.2",
3+
"version": "0.8.3",
44
"type": "module",
55
"description": "scrobble plays from multiple sources to multiple clients",
66
"scripts": {

‎src/backend/sources/YTMusicSource.ts

+12-15
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ export default class YTMusicSource extends AbstractSource {
139139
for(const [k,v] of updated) {
140140
parts.push(`Cookie ${k}: Old => ${v.old} | New => ${v.new}`);
141141
}
142-
this.logger.debug(`Updated Auth -->\n${parts.join('\n')}`);
142+
this.logger.info(`Updated Auth -->\n${parts.join('\n')}`);
143143
} else {
144-
this.logger.debug(`Updated Auth`);
144+
this.logger.verbose(`Updated Auth`);
145145
}
146146

147147
this.currentCreds = {
@@ -235,7 +235,6 @@ export default class YTMusicSource extends AbstractSource {
235235
this.recentlyPlayed = plays;
236236
newPlays = plays;
237237
} else {
238-
239238
if(playsAreSortConsistent(this.recentlyPlayed, plays)) {
240239
return newPlays;
241240
}
@@ -251,20 +250,18 @@ ${humanDiff}`);
251250
} else {
252251
// new plays
253252
newPlays = [...diff].reverse();
254-
}
253+
this.recentlyPlayed = plays;
255254

256-
if(newPlays.length > 0) {
257255
newPlays = newPlays.map((x) => ({
258-
data: {
259-
...x.data,
260-
playDate: dayjs().startOf('minute')
261-
},
262-
meta: {
263-
...x.meta,
264-
newFromSource: true
265-
}
266-
}));
267-
this.recentlyPlayed = newPlays.concat(this.recentlyPlayed).slice(0, 20);
256+
data: {
257+
...x.data,
258+
playDate: dayjs().startOf('minute')
259+
},
260+
meta: {
261+
...x.meta,
262+
newFromSource: true
263+
}
264+
}));
268265
}
269266
}
270267

0 commit comments

Comments
 (0)
Please sign in to comment.