On 2017-05-15 02:30, Carl Hartung wrote:
On Sun, 14 May 2017 22:47:09 +0200 Istvan Gabor wrote:
...
Here's a solution based upon mplayer with community 'one-click' installed codecs:
E.g. place 'streamcap.sh' in ~/bin - - - - - 8< - - - - - #!/bin/bash # Set 'sleep' value, below, to the length of the show plus # whatever leading / trailing times are needed to avoid # inadvertently 'clipping' the show at it's start or end. NOW=$(date +"%Y%m%d") mplayer -vc null -vo null {stream URI} -dumpstream -dumpfile ~/path/$NOW-Program-Name.mp3 & sleep 62m kill $! - - - - - 8< - - - - -
The important thing to know is that in a bash script, $! contains the PID of the previous backgrounded program. $? should contain the PID of the previous command, and $$ the one of the shell or script. With that info it is easy to write a script with wget instead :-) -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))