add build_newurl, catch socket.timeout error