This script is intended to split downloaded YouTube videos according to chapters timing in video description, I initially wrote it to re-upload YT videos to TikTok by subject: to use the script make the video name video.mp4, copy-paste chapters and titles in chapters.txt file in the format:
00:00 Intro
00:05 First subject
...
1:20:00 Last subject
etc..
then run the script in the same folder as both files
output should be video files:
"0 Intro.mp4", "1 First subject.mp4", etc..