Created
April 1, 2024 20:47
-
-
Save meodai/02ad83e596415357968597691c76e899 to your computer and use it in GitHub Desktop.
tv7
This file contains 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
function tv7 | |
echo "Fetching new playlist" | |
set tvcurl (curl --fail https://api.init7.net/tvchannels.xspf -o ~/Movies/Fiber7.TV.tmp.xspf); | |
if test tvcurl | |
echo "Refreshing playlist" | |
if test -e ~/Movies/Fiber7.TV.xspf | |
rm ~/Movies/Fiber7.TV.xspf | |
end | |
if test -e ~/Movies/Fiber7.TV.tmp.xspf | |
mv ~/Movies/Fiber7.TV.tmp.xspf ~/Movies/Fiber7.TV.xspf | |
end | |
else | |
echo "Fetching new playlist failed, using cached one"; | |
end | |
open -a vlc ~/Movies/Fiber7.TV.xspf; | |
#/Applications/VLC.app/Contents/MacOS/VLC -I rc ~/Movies/Fiber7.TV.xspf; | |
end |
This file contains 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 "Fetching new playlist" | |
TVCURL=$(curl --fail https://api.init7.net/tvchannels.xspf -o ~/Movies/Fiber7.TV.tmp.xspf) | |
if [[ $TVCURL ]]; then | |
echo "Refreshing playlist" | |
if [[ -e ~/Movies/Fiber7.TV.xspf ]]; then | |
rm ~/Movies/Fiber7.TV.xspf | |
fi | |
if [[ -e ~/Movies/Fiber7.TV.tmp.xspf ]]; then | |
mv ~/Movies/Fiber7.TV.tmp.xspf ~/Movies/Fiber7.TV.xspf | |
fi | |
else | |
echo "Fetching new playlist failed, using cached one" | |
fi | |
open -a vlc ~/Movies/Fiber7.TV.xspf | |
#/Applications/VLC.app/Contents/MacOS/VLC -I rc ~/Movies/Fiber7.TV.xspf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment