このスクリプト使えばいいんじゃないの?
https://gist.github.com/tablacus/831947fc23f1e6f94eddc323dcfb542c
https://gist.github.com/tablacus/fea97a13a4627fc7485012e6da647015