Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-21-2010, 09:58 PM   #1
Bullpeeper
Junior Member
Bullpeeper began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2010
Device: Kindle
Question Occasional Garbled Characters using this recipe

Using a Kindle 3 and latest version of Calibre. The attached recipe for The Columbus Dispatch returns several articles from RSS feeds with funky characters, especially lots of squares. I've noticed several others with similar problems with different feeds and it seems there might not be an answer - hoping that one of you with .py experience would at least look at the attached recipe i downloaded from the archive to see if there's an issue with it. I have also tried to use the basic mode and just let Calibre create the recipe after i add feeds individually -- those download as messages about flash, the article text, but everything is justified center. Thanks for any guidance anyone may have. I'm not a programmer, so any help is appreciated.
Attached Files
File Type: zip columbusdispatch.zip (2.6 KB, 71 views)
Bullpeeper is offline   Reply With Quote
Old 10-22-2010, 12:43 AM   #2
desertgrandma
Enjoying the show....
desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.desertgrandma ought to be getting tired of karma fortunes by now.
 
desertgrandma's Avatar
 
Posts: 14,277
Karma: 8205255
Join Date: Jun 2008
Location: Arizona
Device: A K1, Kindle Paperwhite, an Ipod, IPad2, Iphone, an Ipad Mini & macAir
Welcome to MobileRead, Bullpeeper

Someone should be along soon with some suggestions.

Enjoy the forums.
desertgrandma is offline   Reply With Quote
Old 10-22-2010, 11:02 AM   #3
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 Bullpeeper View Post
Using a Kindle 3 and latest version of Calibre. The attached recipe for The Columbus Dispatch returns several articles from RSS feeds with funky characters, especially lots of squares.
Do the "squares" appear only on the Kindle? Do you see them in the Calibre viewer?
Starson17 is offline   Reply With Quote
Old 10-22-2010, 07:05 PM   #4
Bullpeeper
Junior Member
Bullpeeper began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2010
Device: Kindle
Thanks, Starson17. The corrupt articles don't have squares in the Calibre viewer but are garbled text. Here's a sample:

������_����K���XIďż˝8ďż˝ k;@��������.ďż˝H3I��4Zďż˝WVVÇ �� ďż˝?+2ďż˝z+���utux�����Yďż˝ď ż˝[��yt{ďż˝sz{qÎŞďż˝ �ڑ�1ďż˝e���Q��c��²��Y=ďż˝ď ż˝ďż˝lEV�� ďż˝qďż˝A9ďż˝o����fďż˝'��w_��Vďż˝ďż ˝6ďż˝$ďż˝/���x��*?���Hďż˝ďż˝ďż˝ďż˝ďż˝ďż˝ďż˝ď ż˝ďż˝ŮĄĎŁďż˝Q����E|2ďż˝a�����8ďż ˝ďż˝ďż˝ďż˝ďż˝ďż˝ďż˝ďż˝l ��Jďż˝yďż˝H����!~����qďż˝ďż˝ďż ˝ďż˝(����꼳V]X��ڸ��E&ďż˝ y��n�������Zďż˝|$����� 5���&{��
Bullpeeper is offline   Reply With Quote
Old 10-22-2010, 08:07 PM   #5
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 Bullpeeper View Post
Thanks, Starson17. The corrupt articles don't have squares in the Calibre viewer but are garbled text.
If you fetch the recipe several times, does the same article always have garbled text, or is it sometimes OK and another has problems?
Starson17 is offline   Reply With Quote
Old 10-22-2010, 10:53 PM   #6
Bullpeeper
Junior Member
Bullpeeper began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2010
Device: Kindle
I've noticed that a particular article will have garbled text one day and if that article happens to come down in the next day's feed as well, sometimes the text will be fine. I would say that it's different articles, but a day has to go by. If i fetch the same recipe in the same day, the same article will have garbled text ... thanks.
Bullpeeper is offline   Reply With Quote
Old 10-23-2010, 10:31 AM   #7
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 Bullpeeper View Post
I've noticed that a particular article will have garbled text one day and if that article happens to come down in the next day's feed as well, sometimes the text will be fine. I would say that it's different articles, but a day has to go by. If i fetch the same recipe in the same day, the same article will have garbled text ... thanks.
It sounds like they may be putting ads or something else into the feeds that interfere. You'll need to look closely manually to see if you can spot the difference. Once you know what it is, you may be able to remove it in the recipe.
Starson17 is offline   Reply With Quote
Old 10-23-2010, 06:25 PM   #8
Bullpeeper
Junior Member
Bullpeeper began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2010
Device: Kindle
Got it, and thanks! When i use Calibre's basic method for creating a news source, by just pasting in the Dispatch's rss link, what fetching produces comes out as all of the text, but justified center. There are also java script and/or flash messages which seem to have something to do with ads at the beginning of many articles. If there are anti-ad recipe elements you know of, please post or link. I'm not a programmer but I'm picking up how some of this works just by comparing recipes that work well with mine that don't.
Bullpeeper is offline   Reply With Quote
Old 10-24-2010, 09:37 AM   #9
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
I finally had time to look at this.
Most of your links from the RSS feed work normally, but occasionally a link like this:

Code:
http://www.dispatch.com/live/content/local_news/stories/2010/10/24/an-illusion-of-treatment.html?sid=101
is sent off to a link like this:
Code:
http://www.dispatchpolitics.com/live/content/local_news/stories/2010/10/24/copy/an-illusion-of-treatment.html?adsec=politics&sid=101
resulting in the problems you see. (Don't you love the political ad season!)
This is done by adding a <meta http-equiv="refresh"> tag to the code.
Add this to your recipe to prevent it:
Code:
remove_tags.append(dict(name = 'meta', attrs = {'http-equiv': 'refresh'}))

Last edited by Starson17; 10-24-2010 at 09:46 AM.
Starson17 is offline   Reply With Quote
Old 10-25-2010, 09:28 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,943
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Another way to do it is with

Code:
def get_browser(self):
   br = BasicNewsRecipe.get_browser(self)
   br.set_handle_refresh(False)
   return br
kovidgoyal is online now   Reply With Quote
Old 10-26-2010, 09:27 AM   #11
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 kovidgoyal View Post
Another way to do it is
Thanks! I didn't think of that option. For my personal reference, as I sometimes search here for bits of code I recall but can't find, there are other optional settings for Mechanize and a list can be found here:
http://wwwsearch.sourceforge.net/mechanize/
Starson17 is offline   Reply With Quote
Old 10-30-2010, 08:39 PM   #12
Bullpeeper
Junior Member
Bullpeeper began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2010
Device: Kindle
Thanks

Quote:
Originally Posted by kovidgoyal View Post
Another way to do it is with

Code:
def get_browser(self):
   br = BasicNewsRecipe.get_browser(self)
   br.set_handle_refresh(False)
   return br
Thanks -- and thanks for the creation of this software.
Bullpeeper is offline   Reply With Quote
Old 10-30-2010, 08:42 PM   #13
Bullpeeper
Junior Member
Bullpeeper began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2010
Device: Kindle
Thanks!

Quote:
Originally Posted by Starson17 View Post
I finally had time to look at this.
Most of your links from the RSS feed work normally, but occasionally a link like this:

Code:
http://www.dispatch.com/live/content/local_news/stories/2010/10/24/an-illusion-of-treatment.html?sid=101
is sent off to a link like this:
Code:
http://www.dispatchpolitics.com/live/content/local_news/stories/2010/10/24/copy/an-illusion-of-treatment.html?adsec=politics&sid=101
resulting in the problems you see. (Don't you love the political ad season!)
This is done by adding a <meta http-equiv="refresh"> tag to the code.
Add this to your recipe to prevent it:
Code:
remove_tags.append(dict(name = 'meta', attrs = {'http-equiv': 'refresh'}))
Starson17 - Greatly appreciate you taking a further look at this. I'm going to cut and paste your code or the code offered by kovidgoyal. This Calibre thing and the recipes for news sources is my favorite thing about my Kindle lately ...
Bullpeeper is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Garbled characters and advertising in feeds lordvetinari2 Recipes 3 10-20-2010 11:48 AM
garbled screen among other issues quibard PocketBook 8 07-13-2010 03:27 AM
PRS-600 Garbled screen edlauzon Sony Reader 8 07-07-2010 07:59 AM
Last character in Nook library garbled Sanddancer Calibre 3 06-21-2010 03:19 PM
Garbled TXT SamCox Amazon Kindle 0 02-20-2010 10:39 PM


All times are GMT -4. The time now is 06:43 AM.


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