# We use sed to replace new lines by the null character so xargs can detect each file correctly
#curl -s $PLAYLIST | sed -e "s|^|\"$PLAYLIST_BASE/|" -e 's|$|"|' -e 's|\n|\x0|' | xargs wget -c
-# Download the playlist
-wget -c $PLAYLIST
-
-# Process each file
+# Dispatch
if [ "$BASENAME" == "playlist-wget" ]; then
+ # Download the playlist
+ wget -c $PLAYLIST
+
cat `basename $PLAYLIST` | while read file; do
dirname="`dirname "$file"`"