savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.36k stars 121 forks source link

Support of the Audioscrobbler protocol is no longer given in the Win X86 releases #1343

Closed MadLostSoul closed 3 years ago

MadLostSoul commented 3 years ago

Describe the bug Since v1.1.2 + Win32 the software is no longer able to support scrobbling to Last.fm or Libre.fm. The Audioscrobbler protocol is already reported as unknown in the script file check with the error message.

Check the local service's LiquidSoap configuration file At line 11, char 13-27: Error 4: Undefined variable lastfm.submit

To Reproduce

set("log.stdout",true)
set("log.file",false)

# Examples

# A playlist sources in monitoring mode with random track selection and volume adjustment via REPLAYGAIN_TRACK_GAIN.
s = playlist("C:\\foo\\bar.m3u", mime_type = "application/x-mpegURL", reload_mode = "watch", mode = "random")
s = amplify(1.,override="replaygain_track_gain",s)

# Last.fm & Libre.fm scrobbeling
s = on_track(lastfm.submit(user="foo", password="bar"), s)
s = on_track(librefm.submit(user="foo", password="bar"), s)

# An output to the local soundcard
output.ao(fallible=true,s)

Expected behavior It would be nice if scrobbling would be possible again in the Win64 version because I use this function intensively, as shown in the code example.

Version details Betriebssystem:Windows 10 Pro Insider Preview Build: 20180.rs_prerelease.200725-1714

Install method https://github.com/savonet/liquidsoap/actions/runs/246485435

toots commented 3 years ago

Thanks for the report! lastfm support has been added back to our 1.4.3 windows build. You can grab one here: https://github.com/savonet/liquidsoap/releases/tag/v1.4.3-pre-release

MadLostSoul commented 3 years ago

I am sorry that I did not express myself correctly and forgot to mention the x64. However, there is now another problem in the x86. It doesn't seem to get to the log file at all; it immediately outputs an error. With the x64 he still criticizes an unknown variable like in my first post. I'm assuming that I only wrote x86 and forgot x64, Typo. Sorry.

Check the local service's LiquidSoap configuration file
Fatal error: exception Invalid_argument ("Sys.signal: unavailable signal")

Press any key . . .

I have to mention that an x86 v1.1.1 runs in parallel on the computer. However, even if I terminate this, the error described occurs.

Release used: https://github.com/savonet/liquidsoap/releases/tag/v1.4.3-pre-release

toots commented 3 years ago

Ha. I figured it out. 24574c6f5a96a37f955decf8388353fee2711bf6 should have fixed it. Any chance you could try the build from: https://github.com/savonet/liquidsoap/actions/runs/249069204 ?

MadLostSoul commented 3 years ago

After my experiment the following behavior results:

Resources used

#ls_service_check.liq <_content follows below_> 
liquidsoap.exe v1.4.3-pre-release https://github.com/savonet/liquidsoap/actions/runs/249069204 _CRC32 BDEBFD19_

Configuration file: #ls_service_check.liq

################################################# 
# LiquidSoap Logging & Connecting
################################################# 
set("log.stdout",false)
set("log.file",true)
set("log.file.path","#ls_service_check.log")
set("log.level",5)

set("server.telnet",true)
set("server.telnet.bind_addr","127.0.0.1")
set("server.telnet.port",1233)
set("server.telnet.revdns",true)
set("server.timeout",120.)

##### The newest 100 songs
s=playlist("\\ liquidsoap\\playlists\\latest.m3u", mime_type="application/x-mpegURL", reload_mode="watch", mode="random")
s=amplify(1., override="replaygain_track_gain", s)

################################################# 
# Testing audio scrobbler (x64)
################################################# 
# Comment out because the title scrobbeling sends the complete content of the playlist file line (m3u/m3u8) as track name.
# s=on_track(lastfm.submit(user="foo",password="bar") s)
# s=on_track(librefm.submit(user="foo",password="bar"),s)

# Safe volume (Windows bug in volume mixer) For test purposes only
s=amplify (0.1,s)

# An output to the local soundcard
output.ao(fallible=true,s)

I had to comment out the scrobbeling. It is now active and working, but it sends too much information in the Scrobble meta tag.

Telnet command [ao.metadata ]: request.metadata 1

extinf_duration="299"
playlist_position="68"
genre="Happy Hardcore, UK Hardcore"
rid="1"
catalog #="CR040"
on_air="2020/09/14 14:39:23"
albumartist="Swifty"
replaygain_track_gain="- 15.16 dB"
discnumber="01/01"
status="playing"
url="https://www.discogs.com/release/6143550"
playlist_length="100"
country="UK"
initial_uri="annotate: extinf_duration=\"299\",artist=\"Swifty\",title=\"This Kind of Music###LSTB_#BPM###LSTB_#179.99###LSTB_#PUBLISHER###LSTB_#Contagious Records###LSTB_#GENRE###LSTB_#Happy Hardcore, UK Hardcore###LSTB_#ALBUM###LSTB_#This Kind of Music###LSTB_#TAGEND\":F:\\MP3\\Publisher (Label)\\Contagious Records\\CR040 (Swifty)-This Kind of Music (2014)\\01-(Swifty)-This Kind of Music.mp3"
tracknumber="01/01"
source="latest(dot)m3u"
temporary="false"
filename="F:\\MP3\\Publisher (Label)\\Contagious Records\\CR040 (Swifty) -This Kind of Music (2014)\\01-(Swifty) -This Kind of Music.mp3"
label="Contagious Records"
bpm="179.99"
title="This Kind of Music###LSTB_#BPM###LSTB_#179.99###LSTB_#PUBLISHER###LSTB_#Contagious Records###LSTB_#GENRE###LSTB_#Happy Hardcore, UK Hardcore###LSTB_#ALBUM###LSTB_#This Kind of Music###LSTB_#TAGEND"
decoder="MAD"
artist="Swifty"
year="2014"
kind="{audio=2; video=0; midi=0}"
discogs_release_id="6143550"
date="2014"
album="This Kind of Music"
replaygain_track_peak="1.441111"
END

The title tag shows the complete line of the m3u file but the title tag should contain ID3 metadata from the MP3 file for the title tag of the song.

flawed:

title="This Kind of Music###LSTB_#BPM###LSTB_#179.99###LSTB_#PUBLISHER###LSTB_#Contagious Records###LSTB_#GENRE###LSTB_#Happy Hardcore, UK Hardcore ###LSTB_#ALBUM###LSTB_#This Kind of Music###LSTB_#TAGEND"

initial_uri="annotate: extinf_duration=\"299\",artist=\"Swifty\",title=\"This Kind of Music ###LSTB_#BPM###LSTB_#179.99###LSTB_#PUBLISHER###LSTB_#Contagious Records###LSTB_#GENRE###LSTB_#Happy Hardcore, UK Hardcore###LSTB_#ALBUM###LSTB_#This Kind of Music###LSTB_#TAGEND\":F:\\MP3\\Publisher (Label)\\Contagious Records\\CR040 (Swifty) -This Kind of Music (2014)\\01-(Swifty)-This Kind of Music.mp3"

correctly:

title="This Kind of Music"

initial_uri="annotate: extinf_duration=\"299\",artist=\"Swifty\",title=\"This Kind of Music\":F:\\MP3\\Publisher (Label)\\Contagious Records\\CR040 (Swifty) -This Kind of Music (2014)\\01-(Swifty)-This Kind of Music.mp3"

Here is another example of a badly scrobbled track: [https://libre.fm/artist/Matzy/track/Burning+Up]https://libre.fm/artist/Matzy/track/Burning+Up%2523%2523%2523LSTB_%2523BPM%2523%2523%2523LSTB_%2523170.02%2523%2523%2523LSTB_%2523PUBLISHER%2523%2523%2523LSTB_%2523Contagious+Records%2523%2523%2523LSTB_%2523GENRE%2523%2523%2523LSTB_%2523Happy+Hardcore%2C+UK+Hardcore%2523%2523%2523LSTB_%2523ALBUM%2523%2523%2523LSTB_%2523Burning+Up%2523%2523%2523LSTB_%2523TAGEND)

The string "###LSTB_#" is only used internally by PHP scripts for further processing. Belongs to the extended tags and should not be included in the file title.

toots commented 3 years ago

Hi!

Thanks for this report, I understand what's going on now.

Could you send an example of the playlist content?

MadLostSoul commented 3 years ago

Gladly, the following excerpt is from failsafe.m3u

#EXTM3U
#EXTINF:172,Die Ärzte - Bela, Du nervst###LSTB_#BPM###LSTB_####LSTB_#PUBLISHER###LSTB_#Hot Action Records###LSTB_#GENRE###LSTB_#Vocal###LSTB_#ALBUM###LSTB_#Männer haben kein Gehirn###LSTB_#TAGEND
D:\liquidsoap\playlists\failsafe\(Die Ärzte)-Männer haben kein Gehirn (Vorlesungen zum Buch)\14-(Die Ärzte)-Bela, Du nervst.mp3
#EXTINF:235,Die Ärzte - Der Scheidenmagnetismus a.k.a. Angriff der Fett-Teenager###LSTB_#BPM###LSTB_####LSTB_#PUBLISHER###LSTB_#Hot Action Records###LSTB_#GENRE###LSTB_#Vocal###LSTB_#ALBUM###LSTB_#Männer haben kein Gehirn###LSTB_#TAGEND
D:\liquidsoap\playlists\failsafe\(Die Ärzte)-Männer haben kein Gehirn (Vorlesungen zum Buch)\24-(Die Ärzte)-Der Scheidenmagnetismus a.k.a. Angriff der Fett-Teenager.mp3

And here is another example in which all additional tags are also filled with values.

#EXTM3U
#EXTINF:289,4orce DJ - Fuckin' With My Head (Outforce vs. Project Shadow Remix)###LSTB_#BPM###LSTB_#174.98###LSTB_#PUBLISHER###LSTB_#Justice Hardcore###LSTB_#GENRE###LSTB_#Happy Hardcore, UK Hardcore###LSTB_#ALBUM###LSTB_#Justice Hardcore pres. Pure Power###LSTB_#TAGEND
F:\MP3\Safe\Radio\Sampler\(Sampler)-Pure Power (2016)\CD02\03-(4orce DJ)-Fuckin' With My Head (Outforce vs. Project Shadow Remix).mp3
#EXTINF:344,Activator - Summer Breeze###LSTB_#BPM###LSTB_#149.92###LSTB_#PUBLISHER###LSTB_#Activa Records###LSTB_#GENRE###LSTB_#Hardstyle###LSTB_#ALBUM###LSTB_#Summer EP###LSTB_#TAGEND
F:\MP3\Safe\Radio\CD's\Maxi\(Activator)-Summer EP (WEB 2012)\01-(Activator)-Summer Breeze.mp3
MadLostSoul commented 3 years ago

First of all I would like to thank you that the Audioscrobbler is part of the Windows releases again!

Can I provide more information to help solve the problem? Let me know.

toots commented 3 years ago

Hello!

These lines:

#EXTINF:172,Die Ärzte - Bela, Du nervst###LSTB_#BPM###LSTB_####LSTB_#PUBLISHER###LSTB_#Hot Action Records###LSTB_#GENRE###LSTB_#Vocal###LSTB_#ALBUM###LSTB_#Männer haben kein Gehirn###LSTB_#TAGEND

Seem to not be following the usual standard for m3u playlists. Typically, the usual standard is described here: https://en.wikipedia.org/wiki/M3U#Extended_M3U and looks like this:

#EXTM3U
#EXTINF:123,Artist Name – Track Title
/path/to/file.mp3

If you need to support additional metadata format like you have here, I'd suggest to look at map_metadata. Using this operator, you should be able to process and transform the unparsed metadata from the m3u playlist.

Hope that makes sense? We can chat further on slack if needed.