From: Oleg Broytman Date: Sat, 22 Sep 2007 18:08:17 +0000 (+0000) Subject: Send Accept-Charset. X-Git-Tag: v4.5.3~306 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=dc704d6e4362a5f48420e5f991519330bf837ded;p=bookmarks_db.git Send Accept-Charset. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@70 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 7a21c4f..77ed46f 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -1,7 +1,7 @@ """ Simple, strightforward robot; guaranteed to has problems with timeouts :) - Written by BroytMann, Mar 2000 - Mar 2004. Copyright (C) 2000-2004 PhiloSoft Design + Written by BroytMann, Mar 2000 - Sep 2007. Copyright (C) 2000-2007 PhiloSoft Design """ @@ -91,7 +91,9 @@ class robot_simple(Robot): url_host, url_path = urllib.splithost(url_rest) url_path, url_tag = urllib.splittag(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] size = 0 last_modified = None diff --git a/doc/TODO b/doc/TODO index c041a66..0ada41e 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,6 +1,4 @@ -Store icon and charset in bookmark's attributes. -ICON="data:image/x-icon;base64,AAABAAIAEBAQAAAAAAAoAQAAJgAAACAgEAAAAAAA6AIAAE4BAAAoAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAACZAJmZAAAAAAmQCZAAAAAACZAJkAAAAAAJkAmQAAAAAAmQCZAAAAAACZAJkAAAAAAAmZmQAAAAAACZmZAAAAAACZAJkAAAAAAJkAmQAAAAAAmQCZAAAAAACZAJkAAAAAAJkAmQAAAAAACZmZkAAAAAAAAAAAAA//////MP///5n///+Z////mf///5n///+Z////wf///8H///+Z////mf///5n///+Z////mf///8D////////ygAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmZkAAJmZmZkAAAAAAAAAAJmZkACZmZmZAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAACZmQAJmZAAAAAAAAAAAAAAmZmZmZmQAAAAAAAAAAAAAAmZmZmZkAAAAAAAAAAAAAAJmZmZmZAAAAAAAAAAAAAAmZmZmZmQAAAAAAAAAAAAAJmZAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAACZmQAAmZkAAAAAAAAAAAAAmZkAAJmZAAAAAAAAAAAAAJmZAACZmQAAAAAAAAAAAAAJmZAAmZkAAAAAAAAAAAAACZmZmZmZmQAAAAAAAAAAAACZmZmZmZkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8PAP//BwD//8PD///Dw///w8P//8PD///Dw///w8P//8PD///Dw///w8P//+HD///gA///8AP///AD///gA///4cP//8PD///Dw///w8P//8PD///Dw///w8P//8PD///Dw///4cP//+AA///wAP///////////w==" -LAST_CHARSET="windows-1251" +Get and store icon. Cleanup HTML before parsing using BeautifulSoap or Tidy. Parse downloaded file and get javascript redirects.