|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Zealot
![]() Posts: 106
Karma: 10
Join Date: Sep 2013
Device: Kindle Paperwhite (2012)
|
How to download news automatically even when you do not keep Calibre always running
The scheduled news downloads only really works when you keep Calibre and your computer running all the time. I do not so until now I would always have to trigger the downloads manually. No more!
This guide assumes you are running linux and systemd. It downloads The Economist, adjust for your recipes. 1) First in calibre, go to Preferences>Sharing>Sharing over the net and a) check "Run server automatically when calibre starts" b) in Advanced tab, check "Allow un-authenticated local connections to make changes". Not that this allows any local programs to delete your library over HTTPS (they are allowed to do that already by running something like "rm ~/Library", so not a security hole). This will ensure a calibre web server is running whenever calibre is running. Calibre does not allow books to be added to it via command line when it is running, unless it is done through the server. This protects the database from corruption. 2) In ~/.config/systemd/user/, create "download_economist.timer" Code:
[Unit] Description="Download the economist once a week" [Timer] OnCalendar=Thu 18:00:00 Persistent=true [Install] WantedBy=timers.target 3) In ~/.config/systemd/user/, create "download_economist.service" (the name before ".service" must be the same as for the timer in step 2)) Code:
[Unit] Description=Script that downloads the economist into Calibre [Service] Type=oneshot ExecStart=~/.local/bin/download_economist.sh Restart=on-failure RestartSec=900 4) The script to download ~/.local/bin/download_economist.sh Code:
#!/bin/bash TMP_FILE=/tmp/economist$(date +%Y-%m-%d).kepub.epub echo $TMP_FILE if ebook-convert "The Economist".recipe $TMP_FILE --output-profile kobo ; then if pgrep -f "/usr/bin/python3 /usr/bin/calibre" >/dev/null; then calibredb add $TMP_FILE --with-library http://127.0.0.1:8080#E-knihy --authors "The Economist" else calibredb add $TMP_FILE --authors "The Economist" fi rm $TMP_FILE else exit 1 fi If you want another recipe, list them with "ebook-convert --list-recipes", the ebook-convert command needs them to be in the form listed by this command. It changes the author field to "The Economist". I love calibre, but I just do not understand why it insists it is the author of the news when it is not. My Library is called E-knihy. Find out what is the name of yours by "calibredb add --with-library http://127.0.0.1:8080#-" Do not forget to make the file executable (chmod +x). 5) Enable and start everything: Code:
systemctl --user enable --now download_economist.timer Last edited by sup; Yesterday at 05:06 AM. Reason: add that it will run even when the computer is off at the given time |
![]() |
![]() |
![]() |
#2 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 33000
Join Date: Feb 2010
Device: Currently:Voyage, Oasis 3, Kindle mobile apps, andKindle Fire
|
I'm on Windows, not Linux, so all this wouldn't work for me anyway. But it all looks a bit complicated. But I'm just curious, as you say, normally you'd have to have your computer on and calibre running in order for news to download. However, even with the above script you'd still have to at least have your computer running. So if the computer is running, why can't you also have calibre running? In my windows setup, I have calibre set to automatically run on Windows startup. And even if the app window itself is not open on the desktop it's still running in the background.
I use a laptop at home and it's always on and hooked up to a monitor. I rarely "take it with me." My problem, and it's probably just a Windows problem, is that Microsoft automatically installs updates once a week and when the computer restarts it doesn't fully load till you enter your password on the welcome screen. So if I'm away for a few days and there's an update my computer is basically locked/disbaled. So I won't get any news downloads. My dream, unrealistc as it is, would be that one day there'd be a calibre app for android and/or iOS. Even if it weren't a full blown editor, maybe it could at least convert books and fetch news. The point being that my phone is "always on" and always with me. Just a dream, I know. My secondary wish would be for MIcrosoft to let Windows fully load after an automatic, unattended update without having to re-enter a password or PIN. I've searched for a way to do that but haven't found one. There's nobody at home but me, so I don't have Windows set the ever lock on its own; it only re-locks after an update. Last edited by mkgtu; 08-14-2025 at 11:22 PM. |
![]() |
![]() |
![]() |
#3 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,784
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
These maybe Windows Pro features:
BR |
![]() |
![]() |
![]() |
#4 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 33000
Join Date: Feb 2010
Device: Currently:Voyage, Oasis 3, Kindle mobile apps, andKindle Fire
|
I also get notified about updates and will usually install them manually while I'm present to unlock the computer after the update. But if I don't do that the update will install automatically in the middle of the night. I think you can set it to ignore updates for x number of days but not indefinitely.
As to the pro thing I have a pro license from previous installations but I don't know if I applied it to the current installation. I'll have to check that. Sent from my SM-G986U1 using Tapatalk |
![]() |
![]() |
![]() |
#5 | |
Zealot
![]() Posts: 106
Karma: 10
Join Date: Sep 2013
Device: Kindle Paperwhite (2012)
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why news-download scheduling requires calibre running non-stop? | sup | Calibre | 11 | 08-14-2025 02:42 PM |
Calibre news automatically deleting | kidblue | Amazon Kindle | 44 | 10-30-2016 01:39 PM |
KindleEar, the Calibre running on GAE, deliver RSS to your kindle automatically. | cdhigh | Kindle Developer's Corner | 15 | 12-27-2015 08:01 AM |
How can you automatically send an scheduled news download to more than one device | laridae2 | Calibre | 1 | 02-26-2012 10:38 PM |
Frequent News Download when calibre is not running | Moik | Calibre | 4 | 10-14-2010 12:16 PM |