Since you asked about whether it could be done, not for legal advice, the answer is yes but it is tricky.
Get on youtube and look for videos about using a Virtual Audio Cable. It is free to download and demo but you'll have to spend about $40 to buy a version that is not watermarked. You might find something free that does the same job.
I tried it and it works but I do NOT use it to restream music. I was just curious about IF it was possible so my friends could pick songs and we could all listen in sync through SL instead of using web and SL together, in the end it was too much hassle.
I use a licensed copy of SAMBC Pro but there are free dj software that VAC will work with too. You can get a cut down version of SAM for free if you buy a cheapest stream for about 6 bucks a month.
So, yeah it can be done (it may be against the terms of service of the site you are streaming from, eg Spotify but you are an adult, you can read them and make up your own mind).