commons.detect_lang()
using requests.instead of urllib
using requests instead of urllib
minor style
using requests instead of urllib
removing urllib.error.HTTPError exception handler

All codes where rewritten using requests.