Rip Radio Stream

From David, 2 Weeks ago, written in Plain Text, viewed 20 times.
URL https://anna.fyi/view/7b2918c4 Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. PLS=http://provisioning.streamtheworld.com/pls/wbapAmAAC.pls
  3. URLS=`/usr/bin/wget -q -O - "$PLS"`
  4. Rush=/mnt/sda1/MP3/Rush/$(/bin/date +%Y%m%d)_Rush.m4a
  5. end=`date +%Y%m%d`
  6. end+="135730"
  7.  
  8. /usr/bin/touch /mnt/sda1/rush
  9. rm /mnt/sda1/rush
  10.  
  11. for url in $URLS ; do
  12.  
  13.         http=`echo "$url" | /bin/grep -Po "(?<=[=])http.*(?=\r)"`
  14.  
  15.         if ! [ -z "$http" ]; then
  16.                
  17.                 /usr/bin/wget -q -O - "$http" >> $Rush &
  18.                 /bin/sleep 2m
  19.        
  20.                 while [ "$(date +%Y%m%d%H%M%S)" -le "${end}" ] && ! [ -z `/usr/bin/pgrep -f "$http"` ]; do
  21.                         /bin/sleep 1m
  22.                 done
  23.  
  24.                 if ! [ "$(date +%Y%m%d%H%M%S)" -le "$((end))" ]; then
  25.                         /bin/kill `/usr/bin/pgrep -f "$http"`
  26.                         break
  27.                 fi
  28.                
  29.         fi
  30.  
  31. done
  32.  

Reply to "Rip Radio Stream"

Here you can reply to the paste above