firedingo

Streamlink Twitch.tv Shell Script

Nov 11th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. StreamLink Twitch.tv Shell Script
  2. ---------------------------------------------------------------------
  3.  
  4. #!/bin/bash
  5.  
  6. #Set Variables Up
  7. EXIT_STATUS=($?)
  8. echo EXIT_STATUS
  9. echo $?
  10. #$2 = 360p
  11.  
  12. #Open a livesteam
  13. echo "Command Received, Attempting to Open Stream"
  14. while [ $EXIT_STATUS==0 ]
  15. do
  16. #streamlink twitch.tv/$1 $2
  17. echo "Please wait...."
  18. streamlink twitch.tv/$1 $2 -np "omxplayer -o hdmi"
  19. EXIT_STATUS=($?)
  20.  
  21. #Report On Script Success
  22. if [ $EXIT_STATUS==0 ]
  23. then
  24. echo $1" Is Live, Opening stream now!"
  25. else
  26. echo "Unable to access twitch.tv/" $1
  27. fi
  28. done
  29. if [ $EXIT_STATUS==0 ]
  30. then
  31. echo "Stream Done, Closing Player"
  32. else
  33. echo "The script failed, please check if you have internet, if the stream is on
  34. fi
Add Comment
Please, Sign In to add comment