striputary is a program that can record audio streams and, given decent information about the recorded content, cut the resulting audio file into songs.
Disclaimer: In an ideal world, you could use such recordings to reduce your personal dependence on large companies and simulatenously save some money which could then be used to support the actual artists whose music you are listening to (who get virtually nothing from their music being streamed). However, recording music off of streaming services is not only against the terms of service of pretty much all streaming providers but also possibly illegal and obviously immoral. Don’t do it! This software has not been written with the idea of it being used but purely for educational purposes (handling audio files is lots of fun!).