View Single Post
Old 01-10-2012, 02:21 AM   #19
kiavash
Old Linux User
kiavash began at the beginning.
 
Posts: 36
Karma: 12
Join Date: Jan 2012
Device: NST
Quote:
Originally Posted by kiklop74 View Post
Let us assume that you have a feed with links that all point to redirected pages. By default Calibre does not handle this case so the safest way of doing this could be summarized like this:

Code:
    def print_version(self, url):
        return self.browser.open_novisit(url).geturl()
Of course similar thing can be done with urllib2 but using internal browser automatically adds support for sites that require login.
Actually you can at the same time get the print page to. Just modify the code to something like this:

PHP Code:
    def print_version(selfurl):
        return 
self.browser.open_novisit(url).geturl().replace('/article.asp?HH_ID=''/Print.asp?Id='
Of course modify the replace part fot your page.
kiavash is offline   Reply With Quote