I did not find a suitable lotion to listen to Last.FM and save the received mp3s, so as not to miss a single introductory second inadvertently [Well, sometimes, a phone distracts there. And on the most interesting track] :)
I decided to try to make a simple version. I haven’t yet reached out to fully implement the HTTP proxy functionality - I’d need to read the RFC. So I decided to use the ready, my favorite, proxy implementation - 3proxy. This is how the plugin for 3proxy turned out, which processes the HTTP stream passing through it and saves the received audio to files. The protocol itself is not complicated, and everything is obvious if you look at it under the sniffer.
The plugin is configured via text config. Now you can configure:
the folder into which you need to add the life of the plugin: lfm_folder "\ last.fm mp3 \" the command tells the plugin to save everything to a folder in the root of the disk.
file name format. 4 macros are supported -% a (artist / artist),% l (album / album),% t (track name / track name),% n (sequence number) lfm_format "% a -% t.mp3" example name - “The Calling - Wherever You Will Go.mp3”