urllib._urlopener = MyURLopener()
# Fake headers to pretend this is a real browser
-_version = "Mozilla/5.0 (X11; U; Linux 2.6 i686; en) Gecko/20001221 Firefox/2.0.0"
-urllib._urlopener.addheaders[0] = ('User-Agent', _version)
-_version = "bookmarks_db (Python %d.%d.%d; urllib/%s)" % (
+_user_agent = "Mozilla/5.0 (X11; U; Linux 2.6 i686; en) Gecko/20001221 Firefox/2.0.0"
+urllib._urlopener.addheaders[0] = ('User-Agent', _user_agent)
+_x_user_agent = "bookmarks_db (Python %d.%d.%d; urllib/%s)" % (
sys.version_info[0], sys.version_info[1], sys.version_info[2], urllib.__version__)
-urllib._urlopener.addheader('X-User-Agent', _version)
+urllib._urlopener.addheader('X-User-Agent', _x_user_agent)
urllib._urlopener.addheader('Referer', '')
-urllib._urlopener.addheader('Connection', 'close')
urllib._urlopener.addheader('Accept', '*/*')
urllib._urlopener.addheader('Accept-Language', 'ru,en')
urllib._urlopener.addheader('Cache-Control', 'max-age=300')
+urllib._urlopener.addheader('Connection', 'close')
urllib_ftpwrapper = urllib.ftpwrapper