05-20-2023, 04:38 PM | #1 |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Pocket Book Sync Koreader book progress with library
Hi all,
I created a small script to sync the current book progress in KoReader with the PocketBook default library. Link: https://github.com/jjrrw174/PocketBo...ith-PB-Library I would like to try and make this run in the background of KoReader. Something like on page refresh, or a configurable timer. If anyone has info on how this could work please reply Info Small .sh script to update PocketBook library with current KoReader book progress TESTED ON POCKETBOOK ERA, LATEST FIRMWARE Requires SH_IVTOOLS A shell script that will take your most recently opend KoReader book and insert or update a record to the PocketBook library. SH_IVTOOL is used to print a summary of the Book title, id, current page, and total number of pages and wether a update or insert happened. How it works:
To install:
To use:
To-do: Add ability to sync all book progress Add ability to detect current page = total pages and mark as complete Add this to KoReader as an automated process(On page refresh, every x minutes, on standy, etc.) |
05-20-2023, 04:49 PM | #2 |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Found a bug that is not taking the true current page. Looking at fixing.
|
Advert | |
|
05-20-2023, 05:37 PM | #3 | |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Quote:
Noticed that going back in the book doesn't update the statistics plugin in the same place. Adding this as a to-do |
|
05-21-2023, 06:19 AM | #4 |
0000000000101010
Posts: 5,743
Karma: 11482159
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
Nice work.
Do you think it would be feasible to sync in both directions? I.e. which ever reader has the furthest progress is synced to the other? |
05-21-2023, 06:31 AM | #5 |
0000000000101010
Posts: 5,743
Karma: 11482159
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
FYI... you can use the built-in "dialog" executable rather than SH_IVTOOL so your script won't need the additional file.
SH_IVTOOL is still very useful for text input though. For example: Code:
dialog 1 "" "Inserted record for Book Title: $currentBookTitle, Book ID: $pbBookID, Current Page: $currentPageNum, Of Total Pages $totalPageCount" "OK" |
Advert | |
|
05-21-2023, 09:18 AM | #6 | ||
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Quote:
Interesting to think about and try though. It may work as the sync sets the total number of pages. Not sure if the reflow would break that or not. Quote:
|
||
05-22-2023, 11:22 AM | #7 |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Created new version V 0.3
Chages: Removed SH_IVTOOL dependencies Removed unused code Removed echos Added error handling Added error output messages Added exits and quits to ensure script fully closes |
05-23-2023, 01:55 AM | #8 |
Guru
Posts: 774
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Very cool! I was missing this without even realizing that I missed it. Thanks!
|
05-23-2023, 02:49 AM | #9 |
Guru
Posts: 774
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Tested (v. 0.4) it with 3 devices with different firmware with the same error:
"Error detected at Getting pocketbook book ID" Devices: PB 631 FW U631_5.20.1527 PB 740 FW U740.6.7.1701 PB 1040 U1040.6.7.1911 v. 0.2 from the 05.21 seems to be working (on all 3 devices) though the pages sync is not as exactly as I hoped, need to do more tests. Last edited by nhedgehog; 05-23-2023 at 03:10 AM. |
05-23-2023, 08:30 AM | #10 | |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Quote:
|
|
05-27-2023, 08:12 PM | #11 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Jan 2023
Device: Kindle Paperwhite
|
Thanks a lot for this tool, very useful!
Is it possible to sync highlights too? |
05-28-2023, 02:22 PM | #12 |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
V 0.5 release
**EDIT**
Seems like the user who runs the software can't create or write to files. Looking for a way around this that doesn't require a root and chmod. ***END*** V 0.5 released today. Includes better error handling. Added Sql Errors Added generic errors Added currentPageUpdateLog.txt to the /applications directory. You will get a better idea of what's happening during the script. Re-writes the file each time the app is run. Not on the list of things yet but something I could look at after trying to get it working in KoReader instead of manual app. Last edited by jrw174; 05-28-2023 at 06:16 PM. |
05-28-2023, 06:18 PM | #13 |
Groupie
Posts: 185
Karma: 194590
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
On PB 631 as well. 0.5 sort of works: only if ssh in the (rooted) device and run the script from shell. In that case I get the dialog "Updated record for Book Title: ... ID: nnnn, Current Page: n, Of Total Pages nnn". And the librarian shows the updated percentage.
If I run the app from the application menu, I only get a dialog with "Error detected at Get KoReader book Id.Error is" trying the ealiser versions: v04 from app, for a change the dialog shows "Error detected at Getting pocketbook book ID". v03 cannot run, probably because of the missing "#!/bin/sh". Let me know if some logs would help. |
05-28-2023, 06:50 PM | #14 | |
Connoisseur
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Quote:
I assumed (incorrectly) that the script was running in the directory I wanted. I added CD /to/correct/dir and now it should work. It was failing on creating the log file since it was in the root dir and not the applications dir. Thanks for giving it a try |
|
05-29-2023, 02:29 AM | #15 |
Groupie
Posts: 185
Karma: 194590
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
yes thanks, with cd /mnt/ext1/applications now it works as .app as well. I have still to understand though under what refresh conditions the librarian shows the updated percentage - if just after changing view a number of times or after a device reboot. I'll keep experimenting a bit.
On a side note: I would have written the log file in /tmp/, so not to clutter the application directory. Compliments for the work, in any event! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sync KOReader progress with Boox Library | Geremia | Onyx Boox | 1 | 11-14-2022 07:55 AM |
Progress sync between koreader and ios | Joretapo | Kobo Reader | 5 | 10-26-2020 08:21 PM |
Looking for an offline method to sync book highlights/notes on KOReader | kokaros | Kindle Developer's Corner | 6 | 03-25-2020 01:35 PM |
How can I change KOReader password for Progress Sync? | frittatahubris | KOReader | 6 | 02-09-2020 08:39 AM |
Aura H2O KSM Wifi keeps turning off / Koreader progress sync | tayseidel | Kobo Developer's Corner | 1 | 12-24-2015 09:27 PM |