Sorry for bothering you with this one. I have little to no knowledege about python or other coding. It will be great and very helpful not only for me but to others also if you will be able to do it.
Regarding the first file, it is from this link from @Rickson if im not mistaken: