Last active
March 7, 2017 15:30
-
-
Save notthetup/f81b0e5694b10a5207d9 to your computer and use it in GitHub Desktop.
SAUVC Streaming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo ".. waiting for network .." | |
while ! ping -c1 8.8.8.8 &>/dev/null; do sleep 1; done | |
export domain='sauvc2017-lab1' | |
# export domain='sauvc2017-lab2' | |
echo ".. fetching script .." | |
curl -Ls https://bit.ly/sauvcscript | bash |
#!/bin/bash
echo ".. registering Pi .."
IP=$(hostname -I | cut -d ' ' -f 1)
qURL="https://www.duckdns.org/update?domains=$domain&token=<token>&ip=$IP"
echo url=qURL | curl -s -k -o /var/log/stream.log -K -
echo ".. starting Stream .."
omxplayer $(youtube-dl -g $(curl -LIs -o /dev/null -w %{url_effective} bit.ly/sauvcstream | xargs))
#!/bin/bash
version=4
echo ".. script version $version .."
echo ".. registering Pi .."
IP=$(hostname -I | cut -d ' ' -f 1)
qURL="https://www.duckdns.org/update?domains=$domain&token=<token>&ip=$IP"
echo url=qURL | curl -s -k -o /var/log/stream.log -K -
echo ".. starting Stream .."
# Previous year videos
# while true; do
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=Qkp23g6SxSc') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=xm1ayLBGGLU') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=inWu5T0Ved8') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=pZfJ0kNywuA') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=0fysBZLbxsM') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=UdaorgZQ1jQ') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=kwCNxf401x4') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=8uX8anL6ZTs') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=3v5yRTkU8Yk') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=rAqqL6XG_6Q') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=cbLnWk_7bbQ') &>/var/log/stream.log
# omxplayer $(youtube-dl -g -f 22 'https://www.youtube.com/watch?v=r6EPuCuPEJ8') &>/var/log/stream.log
# done
# Live Stream
while true; do
while ! ping -c1 8.8.8.8 &>/dev/null; do sleep 1; done
omxplayer $(youtube-dl -g 'https://www.youtube.com/watch?v=_WJbekMYxmE')
done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this to crontab
@reboot /home/pi/runstream.sh > /var/log/stream.log 2>&1