Most of this can be taken care of with various youtube-dl flags! I have afunction called dl_playlist() which implements all of this. Arguments passedto dl_playlist() are transparenltly passed on to any youtube-dl commands,which allows me to pass it a playlist URL, and optionally a proxy.