12-22-2016, 05:34 AM | #1 |
Bibliothekar
Posts: 38
Karma: 10
Join Date: Jun 2011
Location: San Jose City, Philippines
Device: Galaxy Tab S w/Bookari Premium
|
enhancement proposal: DOWNLOADING NEWS
I was going to post this in the development subforum, which is the most logical subforum for making this kind of suggestion, but the 'read this before posting' sticky thread said "This subforum is not the place for....enhancement proposals unless you make clear in your post that you are prepared to develop the enhancements yourself...". It also inconveniently neglected to recommend where to post suggestions, and no subforum description seems to welcome suggestions, so I'm putting it here. If this is the wrong place, then please make an obvious place.
I want to suggest the following changes to News downloading: Calibre should be used only to configure the scheduling of downloads, but not automatically initiate any downloads at all, either upon calibre bootup or by schedule. It should only optionally allow the user to manually initiate a download. Instead, all scheduled downloads of News should be done by calibre-server while it's running. This way I won't have to start calibre every damned day just to initiate a news download, and won't have to leave it running to do scheduled downloads - that's the job of server software running 24/7, not client software which is started only on logins. I also won't have to wait and wait for News download jobs to finish every time I start calibre to make some quick adjustments. (I don't like interrupting jobs, but don't like them interrupting me either.) If there's anyone who, for whatever reason, doesn't want this change, and still wants calibre to do it the current way, then it should be easy enough to include a setting to restore everything to calibre for backward compatibility. This rearrangement of the way News downloads are done would be a great improvement for News. |
12-22-2016, 09:03 AM | #2 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Perhaps it slipped by you that the calibre server is read-only. So it cannot do things like adding new books to the calibre library which is needed for news download. You dont want to run the main calibre program then setup cron jobs to download the news for you. That's what cron is for.
|
Advert | |
|
12-27-2016, 09:00 AM | #3 | |
Bibliothekar
Posts: 38
Karma: 10
Join Date: Jun 2011
Location: San Jose City, Philippines
Device: Galaxy Tab S w/Bookari Premium
|
Quote:
I thought of using crontab, and I figured that if there were a separate program dedicated to doing just that, crontab would be perfect. But when I looked into /opt/calibre/bin/ I didn't see any separate module to handle only downloading news from a cron job, (which would have been a perfect solution.) Or maybe calibre-download-news (or whatever you call it) "slipped by me". So, if I can just start caliber from a cron job just to grab news downloads only, how do I instruct it to do only that, then terminate to free up memory as soon as it's done? I checked "calibre --help" and there's no procedure for this; nothing to tell it to ONLY download news, then exit as soon as it's done. There is a "-s, --shutdown-running-calibre" switch, but then I have to guess how long downloads will take and run a second cron job just to terminate the first. Possible, but messy programming! So tell me, how would you write the cron job so that it only grabs the news then terminates cleanly? |
|
12-27-2016, 09:25 AM | #4 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Deleted
Last edited by Divingduck; 12-27-2016 at 09:36 AM. |
12-27-2016, 01:29 PM | #5 |
Grand Sorcerer
Posts: 12,166
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Did you try reading the calibre FAQ?
I see this You can download news and convert it into an ebook with the command: /opt/calibre/ebook-convert "Title of news source.recipe" outputfile.epub If you want to generate MOBI, use outputfile.mobi instead and use*--output-profile*kindle. You can email downloaded news with the command: /opt/calibre/calibre-smtp I leave figuring out the exact command line as an exercise for the reader. |
Advert | |
|
12-28-2016, 02:15 AM | #6 |
Bibliothekar
Posts: 38
Karma: 10
Join Date: Jun 2011
Location: San Jose City, Philippines
Device: Galaxy Tab S w/Bookari Premium
|
Did you read the OP for this thread? The topic concerns cleanly automating the action of scheduled downloads. What you're talking about is a non sequitur, a red herring. It has nothing to do with being able to automate the downloading of news without having to start up calibre. Is that in the FAQ?
Last edited by Ersatzreifen; 12-28-2016 at 03:55 AM. |
12-28-2016, 02:25 AM | #7 | |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
|
|
12-28-2016, 02:34 AM | #8 | |
Grand Sorcerer
Posts: 12,166
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Quote:
|
|
12-28-2016, 02:40 AM | #9 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Last edited by davidfor; 12-28-2016 at 02:40 AM. Reason: To slow. |
|
12-28-2016, 04:25 AM | #10 | |
Bibliothekar
Posts: 38
Karma: 10
Join Date: Jun 2011
Location: San Jose City, Philippines
Device: Galaxy Tab S w/Bookari Premium
|
Quote:
Peter's post lists two different commands: /opt/calibre/ebook-convert --help Convert an ebook from one format to another. and: /opt/calibre/calibre-smtp --help Send mail using the SMTP protocol. Which one just downloads news? Peter didn't say. The --help feature of each doesn't mention fetching news, so unless you can demonstrate how to use ebook-convert or calibre-smtp just ti initiate a news fetch from the command line, then it looks to me like they weren't designed to do that. One is for converting one book to another format, the other for sending books by email. NEITHER ONE can be used from the command line to download scheduled news feeds, can they? So no, his non sequitur does not tell me how to initiate a news download from the command line. Using crontab isn't the problem. Using crontab is a fricking piece of cake. So if ebook-convert or calibre-smtp has an undocumented feature of fetching news from the command line, then pray tell precisely how. I don't see any documentation on it, nor is it intuitive. |
|
12-28-2016, 04:52 AM | #11 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
And if you had actually read the output from the command you would have seen it handles the news recipes. (Highlighted in red below to make it clear.) Code:
E:\Download>"C:\Program Files\Calibre2\ebook-convert.exe"
Usage: ebook-convert.exe input_file output_file [options]
Convert an ebook from one format to another.
input_file is the input and output_file is the output. Both must be specified as the first two arguments to the command.
The output ebook format is guessed from the file extension of output_file. output_file can also be of the special format .EXT where EXT is the output file extension. In this case, the name of the output file is derived from the name of the input file. Note that the filenames must not start with a hyphen. Finally, if output_file has no extension, then it is treated as a directory and an "open ebook" (OEB) consisting of HTML files is written to that directory. These files are the files that would normally have been passed to the output plugin.
After specifying the input and output file you can customize the conversion by specifying various options. The available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option.
For full documentation of the conversion system see
https://manual.calibre-ebook.com/conversion.html
Whenever you pass arguments to ebook-convert.exe that have spaces in them, enclose the arguments in quotation marks. For example "C:\some path with spaces"
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--list-recipes List builtin recipe names. You can create an ebook from a
builtin recipe like this: ebook-convert "Recipe Name.recipe"
output.epub
Created by Kovid Goyal <kovid@kovidgoyal.net>
|
|
12-28-2016, 04:52 AM | #12 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
I had delete my previous post because I thought, you had look on this already, but maybe not.
calibre help, fetching news via cmd line: PHP Code:
|
12-28-2016, 04:54 AM | #13 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Oh, now we had this two times. Maybe this will help
|
12-28-2016, 12:05 PM | #14 | |
Bibliothekar
Posts: 38
Karma: 10
Join Date: Jun 2011
Location: San Jose City, Philippines
Device: Galaxy Tab S w/Bookari Premium
|
Quote:
Oh. I see. Okay, I give up. You win. You folks simply won't even try to understand my concern, and why I've been trying to suggest a way to make it easier for users,instead of requiring a poor choice between more manual work or clunky memory-wasting workarounds. If all I had to do was this: 0 5 * * * ebook-convert --fetch-scheduled-news-convert-it-and stick-it-in-my-library-and-use-the-settings-from-calibre's-"Schedule-news-download"-to know-what-to-fetch-and-where-to-put-it-without-me-having-to-pedantically-configure-it-manually-for-each-seperate-news-item-and-still-have-to-manage-it-manually-when-changes-are-needed ....THAT sort of thing would have done what I'm looking for. But you're right. Why use the extant "Schedule news download" to set up downloads then have an external module actually perform the downloads, when each user can be forced to leave calibre running or spend countless hours digging through documentation, figuring out how to build up a shell script to do what is mostly already automated, and then have to manage it without the extant gui? I foolishly thought that what I'm looking for would make sense and save time and memory, but requiring users to spend precious hours learning how to manually configure downloads of dozens to hundreds of news sources and tinkering with code is much more fun, isn't it? It's nice to "be able" to micromanage software with such time-consuming configuration options - if you have lots of spare time, but like most people I just don't have enough hours in a day to do everything that needs done. So I want something simpler. I'm funny that way. All I really wanted is something external to calibre, like a module, to take the execution of the actual download out of calibre and allow the user to decide either to allow calibre to initiate the scheduled download as it does now, or to initiate it from a cron job - without users having to either keep calibre running or reinvent the scheduling wheel by having to tediously configure everything from scratch, then still have to "do additional steps like adding to library". And being able to configure it from the existing "Schedule news download" gui makes maintenance easy for users. But I see your point: a separate module for easy automated downloading of news is a silly idea, let's keep it monolithic. Right? Anyone who doesn't like keeping both calibre-server and calibre running 24/7 can just do it the hard way. Right now this "works" (anything works, it just depends on how you define "works"): 0 5 * * * /opt/calibre/bin/calibre 0 6 * * * /opt/calibre/bin/calibre --shutdown-running-calibre ...so I'll just be forced to keep using it until someone figures out what I'm really asking for. It's a sloppy way to do it, I know, and doesn't guarantee that the jobs will all be done before it's terminated, but I don't have enough time every day to do things the tedious way. All I want is a simple external module I can run to get it done, like this: 0 5 * * * /opt/calibre/bin/fetch-news <----<<< (a module, not a homemade script) which will read the settings saved by the "Schedule news download" gui ....without users having to build an involved shell script. (...and the more news sources scheduled, the more involved it gets. Right?) All the code is already built into calibre, trivial for the developers to move, so why can't it be cut out and made in to a separate module so users can easily use it from a cron job? (Rhetorical question.) I had originally suggested moving the code into the calibre-server, but the developers don't want the server being able to initiate the downloads - they want it to remain read-only. So that suggests that a separate module would be better. In ending this thread, here's my suggestion to the developers:
|
|
12-28-2016, 06:30 PM | #15 | |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Quote:
But serious, calibre had a lot of tiny nice kinks, but we all can find that important special one that isn't there. We can ask for it and Kovid will answer with yes, no or maybe some when in the future. Maybe it will come or not. For the meantime there is mostly a workaround available and we are free to use it or not. If there is a problem with a workaround, we can ask and mostly we will receive a kindly and serious answer/help from experienced members or Kovid. That's all what seems to be possible for your special problem for now. Apropos meantime, this is maybe also a good workaround these days: |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
News Downloading Twice | ribena | Devices | 1 | 11-04-2013 08:29 PM |
[Enhancement] Add new news sources of ABC NEWS | donnie888 | Recipes | 0 | 12-23-2012 12:39 AM |
Is there a way to delete old news from the device when downloading new news? | mwheinz | Library Management | 2 | 01-16-2012 12:15 PM |
News downloading | yelloguy | Calibre | 1 | 01-26-2011 03:17 PM |
Downloading News | RobKubo | Calibre | 0 | 11-29-2010 09:42 AM |