I use both YouTube-DL and FFMPEG to accomplish this task. I will say this, creating high quality GIF is by far the easiest part of the whole thing. Bypassing too many request as well as throttling which youtube is very good at was the trickiest part and still is. Making something work for a single user is one thing, scaling so everyone else can use it is a whole different beast. The name of the game is proxy and everything revolves around that.