What should I do if socket.setdefaulttimeout() is not working?

I’m writing a script(multi-threaded) to retrieve contents from a website, and the site’s not very stable so every now and then there’s hanging http request which cannot even be time-outed by socket.setdefaulttimeout(). Since I have no control over that website, the only thing I can do is to improve my codes but I’m running out of ideas right now.