Script for cut ads and concat the file v2

The argument is ID of the video.
If commercials are manually edited it uses Blocks key to generate commands for FFmpeg. Not sure if this will work 100% of the time. If FPS is not integer number I see discrepancy in number of frames defining each block vs frames from "Commercials" key - maybe it's due to rounding therefore timestamps in seconds are used and -ss -to format is used instead of -ss -t. Also it merges blocks of the same type being neighbors in one.

Gist it's my last script as tomorrow my subscription will end