TinyPNG 批量压缩图片脚本
1.Python 环境,
2.tinyPNG sdk
sudo pip install --upgrade tinify
到 TinyPNG 网站上去申请 AppKey,一个月只能压缩 500 张
tinify.key = "your AppKey" # AppKey
fromFilePath = "/Users/zpy/Desktop/test1" # 源路径
toFilePath = "/Users/zpy/Desktop/test2" # 输出路径
运行脚本。打开终端:
python /Users/zpy/Documents/STTinyPNG-Python/98tinyPNG-Python.py