4 echo "Usage: $0 <playlist>"
11 DOWNLOADED_VIDEO="YOUTUBE/"
13 if [ ! -d "$VIDEO" ] || [ ! -d "$DOWNLOADED_VIDEO" ]; then
15 mkdir "$DOWNLOADED_VIDEO"
16 echo "$VIDEO and $DOWNLOADED_VIDEO directories has been created. Use them to upload video files to make playlist updated automatically."
23 VIDEO=$(find "$VIDEO" -type f)
24 YOUTUBE=$(find "$DOWNLOADED_VIDEO" -type f | grep -v ".part")
26 for file in $VIDEO; do
28 if ! grep "$file" "$PLAYLIST" >/dev/null; then
29 echo "$file" >> "$PLAYLIST"
30 echo "VIDEO playlist updated: $file"
34 for file in $YOUTUBE; do
36 if ! grep "$file" "$PLAYLIST" >/dev/null; then
37 echo "$file" >> "$PLAYLIST"
38 echo "YOUTUBE playlist updated: $file"