prazola

mylive - livestreamer simplified frontend

Apr 10th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.01 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. _twitch=('twitch' 'twitch.tv/')
  4. _hitbox=('hitbox''hitbox.tv/')
  5. _mlg=('mlg' 'mlg.tv/')
  6. _chaturbate=('chaturbate' 'chaturbate.com/')
  7. _dailymotion=('dailymotion' 'dailymotion.com/')
  8. _ustream=('ustream' 'ustream.tv/')
  9.  
  10. _quality=('audio' 'high' 'low' 'medium' 'mobile' 'worst' 'source' 'best')
  11.  
  12. _service=''
  13.  
  14. if [ $# = 3 ]; then
  15.     case $1 in
  16.         ${_twitch[0]}) _service=${_twitch[1]}
  17.         ;;
  18.         ${_hitbox[0]}) _service={_hitbox[1]}
  19.         ;;
  20.         ${_mlg[0]}) _service=${_mlg[1]}
  21.         ;;
  22.         ${_chaturbate[0]}) _service=${_chaturbate[1]}
  23.         ;;
  24.         ${_dailymotion[0]}) _service=${_dailymotion[1]}
  25.         ;;
  26.         ${_ustream[0]}) _service=${_ustream[1]}
  27.         ;;
  28.         *) echo 'Wrong service name'
  29.         ;;
  30.     esac
  31.     for i in "${_quality[@]}"
  32.     do
  33.         if [ $3 = $i ]; then
  34.             nohup livestreamer -p baka-mplayer $_service$2 $3 &>/dev/null &
  35.             exit 0
  36.         fi
  37.     done
  38.     echo 'Choose a valid quality.'
  39.     exit 1
  40. fi
Add Comment
Please, Sign In to add comment