![]() |
#1 |
Member
![]() Posts: 13
Karma: 10
Join Date: Dec 2011
Device: Pocketbook 702
|
Source URL / Automated Download
I've begun to use Calibre to manage my collection of IBM Redbooks. They are publicly available, and frequently change.
I currently have a shell script that remembers the source URL for a particular PDF, and I refresh my local copy at long intervals to keep up to date. It is a manual process, I just don't have to navigate the website and manage downloads. Is there a way to have Calibre fetch a PDF from a source URL, and remember it in metadata to facilitate refreshing the copy later? Manually initiated is fine, like a "check for newer version" button for an ebook. Thanks! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,214
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Out of the box, no. You can write your own plugin for it. Or if that is too much work, use the calibredb command line tool in your script.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 13
Karma: 10
Join Date: Dec 2011
Device: Pocketbook 702
|
Thanks for the fast reply!
I wouldn't mind trying to automate it myself, I believe the key would be whether or not I can store an ad-hoc field with the ebook documenting the source URL. Then I could write a plugin or script to test the url for new content. Is Calibre's database flexible enough to add custom fields, or does this already exist? |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,214
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Preferences->Add your own columns
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
You can also add a url as an id. An example I have is "uri:http|//www.gutenberg.org/ebooks/62" ("A Princess of Mars" by Edgar Rice Burroughs). When I select the book, the ids show "www.gutenberg.org" which is click-able and goes directly to the url. Using that, makes it easy to get to the appropriate page and check the current status.
I actually looked at something like this for another site. The solution I was going to use was to create a new id type in the plugin. I got to the point where I could click it on the id to open the page for downloading the file and do a partial search from the metadata editor. I haven't finished this as I hit an issue with needing to login to the site for all the details. And I haven't had time to go back to it. Also, I like the idea of what you are doing. Way back in my mainframe programming days, IBM Redbooks were frequently our saviours. Making them easy to get and update would have been great. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 13
Karma: 10
Join Date: Dec 2011
Device: Pocketbook 702
|
I thought the idea of a "source" field was straightforward, it would be a URL directly to the PDF (no authentication). I'd then have a refresh which would check the date of the remote PDF vs the local, and update unless the size dropped significantly (ie: error).
The issue I just ran into is that I'd like to import my existing redbooks into my Calibre database, but got stuck because it appears I can't add metadata when I add a book. calibredb add lets me specify a filename, but I can't feed it my source field at the same time. My initial efforts to search for the PDF via calibredb list by filename failed as well. If calibredb add returned the UUID in its output, I could then call set_metadata... Any other ideas? |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,214
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
After doing an add, simply do a list and the highest id will be the book you just added
|
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 13
Karma: 10
Join Date: Dec 2011
Device: Pocketbook 702
|
That's a good idea, and it does hold true, I can query the highest index number easily from the command line.
Where I just fell flat is trying to add metadata. Set metadata requires an OPF formatted file, and replaces all metadata on the title in question. Looking at another book I added a source field to and grabbed the OPF, the syntax is huge for the custom field. At this point to do this in a batch script I would have to query the OPF of the newest title, and then have a script edit this XML to add a giant source block and then recommit it. Did I miss something where I can just set one field on a ebook from the command line (ie: "calibredb book# set_field source 'http....' ")? Thanks. |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,214
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You get the OPF with show_metadata, edit it with some XML library and then use set_metadata. There's no single field way of setting metadata from the command line.
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2011
Device: Kobo Touch
|
Definitely post the final solution when you have it. I would use this feature constantly, many open source projects automatically generate their documentation in multiple formats (html, pdf, epub...) and this would be an easy way to keep the most up to date version on my desktop/reader.
|
![]() |
![]() |
![]() |
#11 | |
Member
![]() Posts: 13
Karma: 10
Join Date: Dec 2011
Device: Pocketbook 702
|
Quote:
Could you consider it a feature request to add a parameter that accepts a key/value pair, and may only work for valid metadata keys (including custom ones)? For example: $ calibredb add -t "Book title" myfile.pdf would be equivalent to, assuming -m is for metadata: $ calibredb add -m "title=Book title" myfile.pdf Keys would likely be restricted to a single lowercase word that corresponds to the "lookup name" or column key. Multiple instances of -m should be supported for multiple keys. I could see this as being useful for any number of potential applications, not just for storing a URL. Thanks for your consideration. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Print friendly url unrelated to regular url (and javascript) | sleepless | Recipes | 3 | 12-03-2011 10:43 AM |
Simple download from rss url recipe | BloodOmen | Recipes | 0 | 02-16-2011 09:21 PM |
Gen3 CyBook Gen3 User Guide Download URL | HarryT | Bookeen | 11 | 01-13-2010 02:27 PM |
Calibre's new features - ePub support and automated news download! | astrodad | Calibre | 33 | 08-12-2008 01:05 PM |
Connect Reader Software - Download URL | NatCh | Sony Reader | 13 | 10-17-2007 11:41 AM |