Delete folder with specific condition I need a script to delete a folder, only if the folder does not contain media files with extension avi or mp4.
If all folders to be removed are directly under the containing folder and all mp4 and avi files are directly under the kept folders:

for d in */;do ls "$d"|grep -Eq '.*\.(mp4|avi)$'||echo rm -r "$d";done

If the mp4 and avi files can be in subfolders of the kept folders:

for d in */;do [[ $(find "$d" -iname \*.mp4 -o -iname \*.avi) ]]||echo rm -r "$d";done

If the folders to be removed can be in subfolders of the containing folder:

find . -type d|while read d;do ls "$d"|grep -Eq '.*\.(mp4|avi)$'||echo rm -r "$d";done