translation to python3

used 2to3 script
+ adding user-agent again, was lost in translation