![]() |
#1 |
Hack
![]() Posts: 34
Karma: 12
Join Date: Dec 2009
Device: Kobo Aura HD, Kindle Paperwhite
|
![]()
I am trying to write a recipe for a site that doesn't seem to respond to the calibre HTTP requests with anything valid.
When I open the RSS url in Safari it tailors the XML to the browser feed://www.frontporchrepublic.com/feed/rss/ When I open the web site directly in a recipe: http://www.frontporchrepublic.com I get HTTP Error 403: Bad Behavior If I open the RSS url: feed://www.frontporchrepublic.com/feed/rss/ I get <urlopen error unknown url type: feed> I'm guessing this is because the HTTP Request coming from Calibre doesn't specify a browser type that the web site recognizes. Is there a way to populate the HTTP Request with information to make the website think that Calibre is Firefox or Safari? Thanks! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre mimics browsers anyway by default. IIRC it pretends to be Firefox 3.6.13 on Linux by default.
You can change this by implementing get_browser in your recipe. See the browser() function in the calibre source source |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Search for "Bad Behavior" here, or look at my Skeptic recipe.
The Bad Behavior module can be configured to require headers that the recipe browser may not supply by default. See this post for a possible fix: https://www.mobileread.com/forums/sho...93&postcount=2 |
![]() |
![]() |
![]() |
#4 |
Hack
![]() Posts: 34
Karma: 12
Join Date: Dec 2009
Device: Kobo Aura HD, Kindle Paperwhite
|
Thanks & Thanks
@Starson17 - your code snippet was just what I needed
@kovidgoyal - thanks for inspiring me to check the source |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
Advert | |
|
![]() |
Tags |
http error 403, http request |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Favorite Browsers | =X= | Android Devices | 10 | 06-23-2011 08:01 PM |
Browsers not connecting | lesliesch | enTourage eDGe | 9 | 06-06-2011 08:59 PM |
Books in Browsers? | tomsem | News | 0 | 12-18-2010 11:45 PM |
http://www.morphzone.org request please | trott3r | Recipes | 11 | 10-15-2010 02:20 PM |
What's the differerence between the K2 and K3 browsers? | gollu | Amazon Kindle | 0 | 08-28-2010 10:49 AM |