![]() |
#1 |
Enthusiast
![]() ![]() Posts: 49
Karma: 196
Join Date: Jan 2011
Device: Kindle 3
|
David Bravo's blog v1.0 - Spanish
Hi everybody:
One of the most-notorious writeres in spanish blogosfera is David Bravo, young lawyer who talks about laws, copyright and p2p tech. Always interesting. David Bravo's Blog - laws, copyright and p2p SOURCE CODE: Code:
__license__ = 'GPL v3' __author__ = 'Luis Hernandez' __copyright__ = 'Luis Hernandez<tolyluis@gmail.com>' description = 'blog sobre leyes, p2p y copyright v1.0' ''' http://www.filmica.com/david_bravo/ ''' class AdvancedUserRecipe1294946868(BasicNewsRecipe): title = u'Blog de David Bravo' publisher = u'Filmica' __author__ = 'Luis Hernández' description = 'blog sobre leyes, p2p y copyright' cover_url = 'http://www.elpais.es/edigitales/image.php?foto=par/portada/1551.jpg' oldest_article = 365 max_articles_per_feed = 100 remove_javascript = True no_stylesheets = True use_embedded_content = False encoding = 'ISO-8859-1' language = 'es' timefmt = '[%a, %d %b, %Y]' keep_only_tags = [ dict(name='div', attrs={'class':['blog','date','blogbody','comments-head','comments-body']}) ,dict(name='span', attrs={'class':['comments-post']}) ] remove_tags_before = dict(name='div' , attrs={'id':['bitacoras']}) remove_tags_after = dict(name='div' , attrs={'id':['comments-body']}) extra_css = ' p{text-align: justify; font-size: 100%} body{ text-align: left; font-family: serif; font-size: 100% } h2{ font-family: sans-serif; font-size:75%; font-weight: 800; text-align: justify } h3{ font-family: sans-serif; font-size:150%; font-weight: 600; text-align: left } img{margin-bottom: 0.4em} ' feeds = [(u'Blog', u'http://www.filmica.com/david_bravo/index.rdf')] |
![]() |
![]() |
![]() |
#2 | |
Connoisseur
![]() Posts: 76
Karma: 12
Join Date: Nov 2010
Device: Android, PB Pro 602
|
Quote:
Code:
File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 380: invalid continuation byte |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Enthusiast
![]() ![]() Posts: 49
Karma: 196
Join Date: Jan 2011
Device: Kindle 3
|
Quote:
![]() How can I fix this? Anyway, Calibre is downloading this recipes with no character errors, for instance I can read with no problems this recipe, maybe the best thing is leave this recipes in the forum for personal use only (but my idea was create more recipes for spanish Calibre users) |
|
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
encoding = 'ISO-8859-1' That affects the output and what it sees as the input feed, but the error is that the recipe itself has, "Hernández," instead of "Hernandez." There were some other indent errors for me. Try this one: Spoiler:
|
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() Posts: 76
Karma: 12
Join Date: Nov 2010
Device: Android, PB Pro 602
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
I'm not that knowledgeable about character encoding issues, so I'd like to know if it worked for him, or if he added his name later in the process and didn't test it. The OS may treat his recipe differently if it's set up in a different language, so it doesn't generate that error, or .... maybe he added the error line after the rest was tested. I'm glad the change fixed it for you. (I searched his recipe for E1 in hex to find the problem - amazing what you can solve by reading the error msg).
![]() |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() ![]() Posts: 49
Karma: 196
Join Date: Jan 2011
Device: Kindle 3
|
Fantástico! I catch the STUPID error, thank, thank you for your advices! I've a recipe with no problems (go through the test), look it and try it, please!:
Spoiler:
The error is not the "Hernández" (maybe give errors, but I correct it and the errors didn't go, <joking>anyway, are you saying that my surname is baaad, boy? ![]() The error was one description line, the initial fourth line: Spoiler:
I will revise all my recipes, (published in this forum and not yet -hehe-) and I'll make the test BEFORE publish them in the forum. Starson17, ![]() |
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() ![]() Posts: 49
Karma: 196
Join Date: Jan 2011
Device: Kindle 3
|
David Bravo's Blog (v1.0 code tested)
Ehem, ehem.....
Hi all, I've a new revision of this recipe, this time i tested with: Code:
ebook-convert DavidBravo(es).recipe output_dir --test -vv It convert with no errors with this SOURCE CODE Code:
__license__ = 'GPL v3' __author__ = 'Luis Hernandez' __copyright__ = 'Luis Hernandez<tolyluis@gmail.com>' ''' http://www.filmica.com/david_bravo/ ''' class AdvancedUserRecipe1294946868(BasicNewsRecipe): title = u'Blog de David Bravo' publisher = u'Filmica' __author__ = 'Luis Hernandez' description = 'spanish blog' cover_url = 'http://www.elpais.es/edigitales/image.php?foto=par/portada/1551.jpg' oldest_article = 365 max_articles_per_feed = 100 remove_javascript = True no_stylesheets = True use_embedded_content = False encoding = 'ISO-8859-1' language = 'es' timefmt = '[%a, %d %b, %Y]' keep_only_tags = [ dict(name='div', attrs={'class':['blog','date','blogbody','comments-head','comments-body']}) ,dict(name='span', attrs={'class':['comments-post']}) ] remove_tags_before = dict(name='div' , attrs={'id':['bitacoras']}) remove_tags_after = dict(name='div' , attrs={'id':['comments-body']}) extra_css = ' p{text-align: justify; font-size: 100%} body{ text-align: left; font-family: serif; font-size: 100% } h2{ font-family: sans-serif; font-size:75%; font-weight: 800; text-align: justify } h3{ font-family: sans-serif; font-size:150%; font-weight: 600; text-align: left } img{margin-bottom: 0.4em} ' feeds = [(u'Blog', u'http://www.filmica.com/david_bravo/index.rdf')] |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,190
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you have non ascii characters in your recipe you need to add a coding declaration as the first line
# -*- coding: utf-8 And of curse make sure the recipe file is actually saved in utf-8 |
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
![]() |
#11 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#12 | |
Enthusiast
![]() ![]() Posts: 49
Karma: 196
Join Date: Jan 2011
Device: Kindle 3
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spanish? | OBoyle | General Discussions | 11 | 02-10-2011 08:32 PM |
PRS-600 Menu in Spanish | miguelfer | Sony Reader | 10 | 05-22-2010 01:56 AM |