Signing URLs in Python


I am trying to sign my video URLs in Python, but the example given to do this is in JS. I am not familiar enough with JS so I am not sure how to convert the example code. Has anyone done this in Python before?

Reference article: