diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-10-04 20:58:34 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-10-04 20:58:34 -0300 |
commit | efecff8c26aeca41c62ad9ba88dbec98166360e1 (patch) | |
tree | 48a6fd025c4f6ef0b06d8b599a26e7dd6883c05d /playlist-wget | |
parent | 6295d11dac15034a7acb7a582e9cc8f058d2fac9 (diff) | |
download | playlister-efecff8c26aeca41c62ad9ba88dbec98166360e1.tar.gz playlister-efecff8c26aeca41c62ad9ba88dbec98166360e1.tar.bz2 |
Adds playlist-mpv and playlist-mplayer
Diffstat (limited to 'playlist-wget')
-rwxr-xr-x | playlist-wget | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/playlist-wget b/playlist-wget index b02fd60..63422b9 100755 --- a/playlist-wget +++ b/playlist-wget @@ -27,10 +27,25 @@ PLAYLIST_BASE="$(dirname $(dirname $PLAYLIST))" # Download the playlist wget -c $PLAYLIST -# Download playlist and all it's files preseving the folder structure +# Process each file cat `basename $PLAYLIST` | while read file; do dirname="`dirname "$file"`" - mkdir -p "$dirname" - wget -c "$PLAYLIST_BASE/$file" -O "$file" + if [ "$BASENAME" == "playlist-wget" ]; then + # Download playlist and all it's files preseving the folder structure + mkdir -p "$dirname" + wget -c "$PLAYLIST_BASE/$file" -O "$file" + elif [ "$BASENAME" == "playlist-mpv" ]; then + # Play using mpv + mpv "$PLAYLIST_BASE/$file" + elif [ "$BASENAME" == "playlist-mplayer" ]; then + # Play using mplayer + mplayer "$PLAYLIST_BASE/$file" + fi done + +# Remove playlist if on stream mode +# This should be implemented as a shell trap +#if [ "$BASENAME" == "playlist-mpv" ] || [ "$BASENAME" == "playlist-mplayer" ]; then +# rm `basename $PLAYLIST` +#fi |