Skip to content

Instantly share code, notes, and snippets.

@meodai
Created April 1, 2024 20:47
Show Gist options
  • Save meodai/02ad83e596415357968597691c76e899 to your computer and use it in GitHub Desktop.
Save meodai/02ad83e596415357968597691c76e899 to your computer and use it in GitHub Desktop.
tv7
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
#!/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