Skip to content

Instantly share code, notes, and snippets.

@dewomser
Created October 10, 2020 13:17
Show Gist options
  • Save dewomser/01f41e33c1102ce808b0079fc860e54b to your computer and use it in GitHub Desktop.
Save dewomser/01f41e33c1102ce808b0079fc860e54b to your computer and use it in GitHub Desktop.
Check for fresh videos in folder. A Bash script uses KDE notify-send
#!/bin/bash
# This shows new Viedoclips. Script is tested with Kubuntu 20.04 and uses notify-send Popup-Window
# edit dl-folder for your needs
#It does not fail if nothing pops up. there was propably no fresh Video in the last 4 hours.
#If you want to be remembered regulary there is this line for your user crontab :
#0 * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /home/foo/bin/yt-dl-send-notify.sh
dl_folder=~/Downloads/videos/
f=$(find $dl_folder -newermt '4 hours ago' -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
if [ -z "$f" ]
then exit
else
folder1="$(echo $dl_folder|sed "s/\//\\\\\//g")"
sedarg="sed s/$folder1/\n/g"
f1=$(echo "$f"|$sedarg)
notify-send --icon=video-x-generic "$f1": "Open folder: <a href='$dl_folder'>clips</a>"
fi
@dewomser
Copy link
Author

This Video checker is part of my FF-Youtube-dl Project
https://github.com/dewomser/FF-auto-youtube-download-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment