When adding an image or video file (does the add image script work with video files?), check that the file is of an acceptable image.video type by looking at the file's extension.
Perhaps create an array of acceptable file types at the top of the script:
When adding an image or video file (does the add image script work with video files?), check that the file is of an acceptable image.video type by looking at the file's extension.
Perhaps create an array of acceptable file types at the top of the script:
ACCEPTABLE_MEDIA_EXTENSIONS=( "jpg" "png" mp4" ...etc )
Then, before downloading the file, confirm the link/file has an extension that is in the array. If not, Quit with explanation.