get media caption

I'm sure this is not the best python code but would love if someone could clean it and push it.

Thanks