From: Oleg Broytman Date: Sun, 30 Dec 2007 21:04:21 +0000 (+0000) Subject: Added a comment. X-Git-Tag: v4.5.3~224 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=3dc28a60e36febe88eefd03dd9254d4623f8aa53;p=bookmarks_db.git Added a comment. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@152 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 399cf06..f1d8bb3 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -106,7 +106,9 @@ class robot_simple(Robot): url_host, url_path = urllib.splithost(url_rest) url_path, url_tag = urllib.splittag(url_path) + # Set fake referer to the root of the site urllib._urlopener.addheaders[2] = ('Referer', "%s://%s%s" % (url_type, url_host, url_path)) + if bookmark.charset: urllib._urlopener.addheader('Accept-Charset', bookmark.charset) fname, headers = urllib.urlretrieve("%s://%s%s" % (url_type, url_host, url_path), self.tempfname) if bookmark.charset: del urllib._urlopener.addheaders[-1]