Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 07-20-2011, 02:25 AM   #1
TacitGibbon
Junior Member
TacitGibbon began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2011
Device: Kindle
Using Internet Explorer to download in Calibre

Calibre's recipe for a few newspapers ( like WSJ ) allows for user to provide login for full version access. My institution provides access to some of these sites via cookies ( You visit a custom Url that sets cookie in IE for x days for which one will have full access to the sites on that machine using IE)

Is there a way to configure calibre to use IE ( or IE cookies ) to download news pages ?
TacitGibbon is offline   Reply With Quote
Old 07-20-2011, 09:05 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by TacitGibbon View Post
Calibre's recipe for a few newspapers ( like WSJ ) allows for user to provide login for full version access. My institution provides access to some of these sites via cookies ( You visit a custom Url that sets cookie in IE for x days for which one will have full access to the sites on that machine using IE)

Is there a way to configure calibre to use IE ( or IE cookies ) to download news pages ?
Are you saying that only IE works (FireFox and Chrome, etc. do not) or just that cookie support is required. I suspect it's just a cookie issue, and yes, the recipe system supports cookies. The recipe has to be written to go to the login page, provide the user/pass, which sets the cookies and then retrieve articles.

I wrote some code like this for Google Reader authentication that you can look at.
Starson17 is offline   Reply With Quote
Advert
Old 07-21-2011, 06:52 PM   #3
khromov
Connoisseur
khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.
 
Posts: 83
Karma: 499304
Join Date: Jul 2011
Device: Kindle
A cookie is just a text string though, so Tacit can read the content of the cookie (possible to do in all browsers) and then set the cookie in the recipe. You could also make the cookie last forever unless they specifically blocked that on the server end.

As for setting a cookie it is done by using get_browser() in calibre to fetch the browser object and then set the cookie by creating a "cookie jar" and adding a cookie to it - Calibre uses the "mechanize" python browser. Please see this for further documentation and help:
http://wwwsearch.sourceforge.net/mechanize/
khromov is offline   Reply With Quote
Old 07-22-2011, 10:11 AM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by zapt0 View Post
A cookie is just a text string though, so Tacit can read the content of the cookie (possible to do in all browsers) and then set the cookie in the recipe. You could also make the cookie last forever unless they specifically blocked that on the server end.

As for setting a cookie it is done by using get_browser() in calibre to fetch the browser object and then set the cookie by creating a "cookie jar" and adding a cookie to it - Calibre uses the "mechanize" python browser. Please see this for further documentation and help:
http://wwwsearch.sourceforge.net/mechanize/
Yes, that's how it's done (there's no need to explicitly set the cookie jar or use mechanize unless you need to modify the cookies or want to track them for debugging, as get_browser does it all for you), but he seemed to be saying that only IE worked (I suspect it's not true, but one can't be sure).
Starson17 is offline   Reply With Quote
Old 07-22-2011, 10:47 AM   #5
khromov
Connoisseur
khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.khromov ought to be getting tired of karma fortunes by now.
 
Posts: 83
Karma: 499304
Join Date: Jul 2011
Device: Kindle
Quote:
Originally Posted by Starson17 View Post
Yes, that's how it's done (there's no need to explicitly set the cookie jar or use mechanize unless you need to modify the cookies or want to track them for debugging, as get_browser does it all for you), but he seemed to be saying that only IE worked (I suspect it's not true, but one can't be sure).
Yeah it sounds kind of fishy that it'd only work in IE, worst-case one can always spoof the user-agent.
khromov is offline   Reply With Quote
Advert
Old 07-22-2011, 11:01 AM   #6
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by zapt0 View Post
Yeah it sounds kind of fishy that it'd only work in IE, worst-case one can always spoof the user-agent.
Yes, or modify some other header, as needed. I was working on getting a baseline on what he needed for authentication before going into details. Your post saved me the trouble
Starson17 is offline   Reply With Quote
Old 07-26-2011, 07:28 PM   #7
TacitGibbon
Junior Member
TacitGibbon began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2011
Device: Kindle
Thanks folks. I did not say (or know if ) it works Only on IE. All I was trying to say was that the access to sites are provided using cookie method. I visit site http://www.internalsite.net/provider=newspaper and it redirects and sets a cookie after which I am able to access the newspaper using the browser.

You guys have suggested using the get_browser() method, but a bit more details would help given I'm not very technical, but interested in getting this working.

Thanks a ton !

Tacit
TacitGibbon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone The Guardian UK: The iPhone is the new Internet Explorer 6, says mobile developer kjk Apple Devices 24 02-10-2010 07:32 AM
Internet Explorer 7 pre-Beta 2 available for download MrSaint Lounge 1 02-02-2006 08:40 AM
Internet Explorer 7 will have tabs - will Firefox users switch back? Colin Dunstan Lounge 9 03-16-2005 08:38 AM
Internet Explorer in Windows XP SP2 - more secure? Alexander Turcic Lounge 1 08-11-2004 07:22 AM


All times are GMT -4. The time now is 04:06 PM.


MobileRead.com is a privately owned, operated and funded community.