Author Topic: Record more radio streams with this alternative to Streamripper  (Read 1304 times)

sveakul

  • Hero Member
  • *****
  • Posts: 3296
A new alternative radio stream ripper, LiquidSoap-Record (LSR), has been made available, developed by "zeremy" from the Foobar forum.  Like Streamripper, it's a command line application that produces separate artist/title tagged files from radio stream track metadata.  The difference is that unlike Streamripper LSR will produce lossless direct-stream copies (not transcodings) of even FLAC and Opus streams, properly done with Vorbis tags.   It also handles MP3, AAC, and OGG as expected.

Installation involves downloading the Liquid Soap application (https://github.com/savonet/liquidsoap/releases/tag/v2.2.5) available in a zipped x64 Portable version, and installing it for example to C:\liquidsoap.  It also requires that ffmpeg and ffprobe exist on the user's PC and be present in the Windows PATH environment variable.  Finally, the following modified file needs to be downloaded and copied over the existing one in the liquidsoap directory: https://github.com/smoralis/liquidsoap-record/blob/main/record.liq .

For use in MusicBee it needs to be added like Streamripper as an External Tool (Prefs/Tools/External Applications).  Give it a label like "LSR", and in the application path box "C:\liquidsoap\liquidsoap.exe" depending on where you put the liquidsoap app.  In the Parameters box, enter the following:

Code
"C:\liquidsoap\record.liq" -- -url "<URL>" -dir "C:\Streams"

The last folder should be the one you want the tracks recorded to.  LSR by default will use direct stream copy on all formats, however a full range of transcoding options are available using the options documented on the LSR GitHub page: https://github.com/smoralis/liquidsoap-record .

Set LSR to start recording a stream in MusicBee by assigning the external tool entry a shortcut, adding it as a Toolbar button, or by right-clicking the control bar and choosing it from the Send To->External Tool menu.  A command window will open and ffmpeg/liquidsoap initiating parameters will be shown, followed by an ongoing indication that the track is being recorded.

Recording can be stopped/LSR exited by CTRL-C or exiting the command window.  As with Streamripper the attempt is made to end and begin new track files at the proper time interval, although stations' usual practice of running one track into the next make this a best-effort task.  An m3u file is also created by default but that function can be commented out in record.liq (lines 153-156).

I tested this fully using Windows 11 x64 for the author and it works great--give it a try!  Questions welcome.
Last Edit: September 13, 2024, 07:51:03 AM by sveakul

sveakul

  • Hero Member
  • *****
  • Posts: 3296
This ripper was updated a couple of days ago to handle stream URLS that require a user API key appended to the address (like the now-pay "DI.FM" multi-genre electronica based site).  You would need to download a new record.liq (https://github.com/smoralis/liquidsoap-record/blob/main/record.liq).  However the user needs to supply their key in the URL.

haggers

  • Jr. Member
  • **
  • Posts: 23
Thank you for sharing, ways of making direct stream copies are always handy (i.e. Streamlink for video streams).

sveakul

  • Hero Member
  • *****
  • Posts: 3296
This script has been updated to v.1.0.24 2024-10-30, downloadable as record.liq at the same link in the first post.  It adds the download and embed of any stream-delivered logo/other images to the resulting file and better FLAC handling.  The image embedding may be declined by commenting out lines 246-259, and line 277.  The files are tagged using the id3v2.4 format for mp3 and Vorbis Comment for FLAC.  AAC streams are automatically and losslessly wrapped in taggable .m4a.
Last Edit: November 20, 2024, 12:09:46 AM by sveakul

sveakul

  • Hero Member
  • *****
  • Posts: 3296
Updated record.liq script LSR #v.1.0.32 2025-01-25 has been posted by zeremy at github.

Also, nothing to comment out anymore if you don't want cover art downloaded or an M3U list created--those are now the default settings.  If you want them, change the "<0>" to "<1>" at the end of line #4.

File fragments less than 10 seconds long are deleted by default;  that length can be altered in the script by altering the "f.duration" value in lines #416-427.

This is all using the newly updated liquidsoap 2.3.0 x64:  https://github.com/savonet/liquidsoap/releases/download/v2.3.0/liquidsoap-2.3.0-win64.zip.  Uses script caching and memory optimization.

See first post for installation instructions.