![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Help needed for "Tagespost" recipe
Might be this is a beginners issue:
I tried to write a recipe for the "Tagespost" newspaper. It'sthis: Code:
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1589629735(BasicNewsRecipe): title = 'Tagespost' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True feeds = [ ('Tagespost', 'https://www.die-tagespost.de/storage/rss/rss/die-tagespost-komplett.xml'), ] def print_version(self, url): return url + "/print/yes" def get_browser(self, *a, **kwargs): kwargs['verify_ssl_certificates'] = False return BasicNewsRecipe.get_browser(self, *a, **kwargs) extra_css = 'td.textb {font-size: medium;}' Can someone, please, tell me what I'm doing wrong? |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 22
Karma: 10
Join Date: Nov 2011
Location: Australia
Device: Kindle 4
|
Try this:
I added use_embedded_content = False which tells Calibre to follow the links in the feed (not just use the summary) I also commented out the other sections with a # as they aren't needed. Code:
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1589629735(BasicNewsRecipe): title = 'Tagespost' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True use_embedded_content = False feeds = [ ('Tagespost', 'https://www.die-tagespost.de/storage/rss/rss/die-tagespost-komplett.xml'), ] # def print_version(self, url): # return url + "/print/yes" # def get_browser(self, *a, **kwargs): # kwargs['verify_ssl_certificates'] = False # return BasicNewsRecipe.get_browser(self, *a, **kwargs) extra_css = 'td.textb {font-size: medium;}' |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Great! That works phantastically, even pictures appear! Thank you so much!
Would you like to add the recipe to Calibre's collection, once you had dealt with the work? I still have only a slight idea about what has been the trick. |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 22
Karma: 10
Join Date: Nov 2011
Location: Australia
Device: Kindle 4
|
Sure, I think Kovid usually is kind enough to add them from here to Calibre.
Here's a tidier version that Kovid might be able to use: Code:
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import unicode_literals, division, absolute_import, print_function __license__ = 'GPL v3' __copyright__ = '2020, Pat Stapleton <pat.stapleton at gmail.com>' ''' Recipe for Die Tagespost ''' from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1589629735(BasicNewsRecipe): title = 'Tagespost' language = 'de' __author__ = 'Pat Stapleton' description = 'Die Tagespost trägt den Untertitel Katholische Wochenzeitung für Politik, Gesellschaft und Kultur und ist eine überregionale, wöchentlich im Johann Wilhelm Naumann Verlag in Würzburg erscheinende Zeitung.' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True use_embedded_content = False feeds = [ ('Tagespost', 'https://www.die-tagespost.de/storage/rss/rss/die-tagespost-komplett.xml'), ] extra_css = 'td.textb {font-size: medium;}' |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Thank you both!
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Still a tiny little Question, Born in attack of perfectionism:
Many news sources that appear in calibre's collection show their logo as sort of an icon. The "Tagespost" has such a logo, too (see attachment). How does one manage to make the logo appear instead of the default? And is it possible to replace Calibre's default cover (which is a big feature of its own, there's no doubt) by the logo at downloading the news on Calibre's bibliotheque (and on the Reader)? |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You want a cover, you set cover_url in the recipe. As for the logo, if you can come up with a small 32x32 or 64x64 logo, I will be happy to add it.
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
I'll do my very best!
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Here it is: I hope that's o.k.
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
that will be illegible at small sizes, might be better to just use the blue logo between die and tagesspost as the icon.
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
That's good idea:
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If yo uuse cover_url whatever image it points to will be used as the cover, there wont be any metadata added to it, like with a generated cover.
|
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Ah, thank you!
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recipe for EPUB subscribers of "Tagesspiegel" and "Handelsblatt"? | F.W. | Recipes | 0 | 05-14-2013 11:16 AM |
New recipe for "Süddeutsche Zeitung" using "E-Paper mobile" subscription | Ernst | Recipes | 3 | 02-16-2013 07:37 AM |
Recipe for "Galicia Confidencial" and "De L a V" | roebek | Recipes | 1 | 07-19-2011 09:17 AM |
"The Three Laws of Zombiotics" - STORIES, PSEUDO NON-FICTION, POETRY, ETC. NEEDED | Dr. Drib | Writers' Corner | 109 | 04-26-2011 12:41 PM |