![]() |
#1 |
Enthusiast
![]() Posts: 35
Karma: 10
Join Date: Oct 2011
Device: Kindle 3
|
How add a simple cover to a custom news source?
Hello,
Sorry but I have tried hard following different indications in the forum to add to my custom recipes a simple cover image, different from the one produced by Calibre. Could anyone provide me with an easy to copy and paste solutions to add a cover? I tried to add this in the "Advanced Mode" box: def get_cover_url(self): cover_url = "actual url" return cover_url but Calibre gives me an error message. Should I add something else? Thanks! |
![]() |
![]() |
![]() |
#2 |
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Oct 2010
Device: Kindle
|
I don't see why your code snipplet doesn't work. But did not properly indent your code as follows?
Code:
class YourRecipe(BasicNewsRecipe): ... def get_cover_url(self): cover_url = "actual url" return cover_url .... |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 35
Karma: 10
Join Date: Oct 2011
Device: Kindle 3
|
Thanks tylau0!
Now it is working... |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 10
Karma: 10
Join Date: Apr 2021
Device: KT2 7th gen
|
What would I type for "actual url" if I want to use a local image file? I know I need to use the whole path, but what goes before this? Thanks.
|
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,021
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
see: https://en.wikipedia.org/wiki/Unifor...rce_Identifier |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 10
Karma: 10
Join Date: Apr 2021
Device: KT2 7th gen
|
I'm still failing to get news recipe to download a cover. I have looked at similar problems on this forum and have tried:
1. adding the above code with the suggested line formatting: def get_cover_url(self): cover_url = "file///link/to/picture.png" return cover_url 2. I inserted this line into the recipe in the 'class' section: cover_url = 'file:///home/ian/Downloads/aljazeera.png' In the job log I just see this entry at the bottom: The cover image has an id != "cover". Renaming to work around bug in Nook Color Does anyone have any helpful pointers? Thanks. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,318
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You want
Code:
def get_cover_url(self): return 'file:///home/ian/whatever.jpg' |
![]() |
![]() |
![]() |
#8 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 615
Karma: 85520
Join Date: May 2021
Device: kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,021
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Oct 2022
Device: kindle paperwhite
|
Add a date stamp to a custom RSS recipe cover
@kovidgoyal Thanks ! I've finally added a custom cover, can I stamp a date in my custom covers just as Calibre does when it generates a default cover?
![]() |
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,318
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to generate the cover programitcally in that case, how you do it depends on what exactly you want to do. your best bet would be to use a tool like imagemagick to do it. If you want to do it using calibre then look at the various functions at the bottom of the ebooks/covers.py file in the calibre source code.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
No "Add a custom news source" | jmkizer | Recipes | 1 | 11-23-2011 05:48 PM |
Using print_version for custom news source | sexymax15 | Recipes | 0 | 06-15-2011 10:53 AM |
Custom News Source | scrumhalf | Recipes | 5 | 11-26-2010 11:30 AM |
Custom news source - for forums | RichD | Calibre | 0 | 01-12-2010 11:05 AM |
Custom news source | JayCeeEll | Calibre | 2 | 11-14-2009 04:01 AM |