Compress JPEG is a python script that takes a directory or file path as a parameter. If the path is a directory, all image files within the directory will be reduced in size (to a certain limit). If the path is an image file, the single image will be reduced in size.
python3 compressjpeg.py path
Pillow (https://github.com/python-pillow/Pillow/) v7.1.2