I haven't understood how youtube-dl code work as a whole. So it would be good for you to submit a pull request.