![]() |
#1 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Sep 2016
Device: Kindle voyage
|
How to obtain the URL of the article in postprocess_html
Hi there,
I have coded a recipe that retrieves URL from Todoist (task app) and builds an epub https://github.com/rga5321/todoist2e...Todoist.recipe I would like to recover the URL of every article so I can add it in the HTML (it is coded in a separate part of the project, but it doesn't work. I want to do it inside the recipe) In parse_index, for every chapter, I add every article with these metadata (line 178): Code:
arts.append({ 'title': title, 'url': url, 'date': item['date_added']}) Can anyone point me in the right direction? Thanks a lot, regards |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,410
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre add a footer with the URL each article was fetched from automatically, you dont need to do anything.
|
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Sep 2016
Device: Kindle voyage
|
Hi kovidgoyal,
Thanks for your reply. Where does it do it, exactly? Because I must be overriding the function that does it, as the calibre footer that you mention doesn't appear in the ebook generated with my recipe. Thanks, |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,410
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC if you have your output profile set to kindle it wont, for epub with a non kindle profile it will. And it happens in _postprocess_html() I think
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Sep 2016
Device: Kindle voyage
|
Hi kovidgoyal,
Are you sure that it is done in postprocess_html? I have: - Commented my postprocess_html function, so the default one is used - Forced the generic_eink profile while running the recipe with ebook-convert (--output-profile=generic_eink) And still the articles doesn't have the footer. If you could point me to the code in calibre that does it I would really appreciate it. Regards, |
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,410
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Note the leading underscore
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to insert article URL? | Mixx | Recipes | 4 | 01-09-2014 01:26 PM |
Article download fails if I use postprocess_html function | oecherprinte | Recipes | 3 | 11-26-2013 04:17 PM |
New York Times - Link to article URL? | gianfri | Recipes | 2 | 11-09-2013 09:53 PM |
Get article URL in postprocess_html | rmflight | Recipes | 5 | 11-29-2012 11:37 AM |
Trying to strip the date from an article URL | Finbar127 | Recipes | 1 | 02-17-2011 03:02 PM |