![]() |
#16 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 199
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
I think I have a somehow workable solution now.
First, I put this in a file /mnt/ext1/system/bin/askwhichreader.app Code:
#!/bin/sh dialog 2 "" "Open $1 with:" KOReader eink-reader "Not now" ans=$? if [ $ans == "1" ]; then echo "$1":koreader.app >> /mnt/ext1/system/config/handlers.cfg /mnt/ext1/system/bin/koreader.app "$1"; fi if [ $ans == "2" ]; then echo "$1":eink-reader.app >> /mnt/ext1/system/config/handlers.cfg eink-reader.app "$1"; fi Code:
pdf:@PDF_file:1:askwhichreader.app,koreader.app,eink-reader_with_pdfium.app,eink-reader_with_rmsdk.app:ICON_PDF epub:@EPUB_file:1:askwhichreader.app,koreader.app,eink-reader.app:ICON_EPUB Now what happens when I tap on an .acsm file is the following:
The same dialog should pop up also any time an unassociated new file is opened for the first time. And if I want at later time to change its reader association, I can always use the long press pop-out chooser menu. I have still to test this solution on the long run, but it seems reasonably ok. Instead of choosing automatically the reader program as part of the downloading pipeline, which I was not able to intercept, there is one more tap on the dialog involved, but it's imho already an improvement. Last edited by EastEriq; 11-08-2024 at 08:36 AM. |
![]() |
![]() |
![]() |
#17 |
0000000000101010
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
Seems like you only need to trigger user input if the "Digital Editions" directory is where the book is being opened from. So how about something like:
Code:
#!/bin/sh appDir=/ebrmain/cramfs/bin bookDir=$(dirname "$1") function checkDir { if [ "$bookDir" == "/mnt/ext1/Digital Editions" ]; then digEdit=1 else digEdit=0; fi } function default { exec /mnt/ext1/applications/koreader.app "$1" exit } function setKorRead { echo "$1":koreader.app >> /mnt/ext1/system/config/handlers.cfg exec /mnt/ext1/applications/koreader.app "$1" } function setPbRead { echo "$1":eink-reader.app >> /mnt/ext1/system/config/handlers.cfg exec $appDir/eink-reader.app "$1" } function askUser { $appDir/dialog 2 "" "Open $1 with:" "KOReader" "eink-reader" "Not now"; ans=$? if [ $ans == "1" ]; then setKorRead elif [ $ans == "2" ]; then setPbRead elif [ $ans == "3" ]; then default else askUser; fi } checkDir if [ $digEdit == 1 ]; then askUser else default; fi exit You could also use this script as a replacement for /mnt/ext1/system/bin/koreader.app as I previously suggested. This .app file is not overwritten by Koreader updates. It would mean the changes to extensions.cfg are not necessary. Is user input even required if you can test for the "Digital Editions" directory? If not my initial much simpler script (now updated) would be sufficient. Last edited by neil_swann80; 11-09-2024 at 06:49 AM. |
![]() |
![]() |
![]() |
#18 | ||
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 199
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
Quote:
Philosophically I prefer editing extensions.cfg over koreader.app but thank you for suggesting alternatives. It seems odd to me that the loader of koreader should include the fallback to the other program. Quote:
![]() ![]() ![]() |
||
![]() |
![]() |
![]() |
#19 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The problem is that when you get a .acsm results in an ePub with DRM. KOReader cannot read an ePub with DRM.
|
![]() |
![]() |
![]() |
#20 |
0000000000101010
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
|
![]() |
![]() |
![]() |
#21 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
You can't automate this. You need to use calibre with DeDRM to remove the DRM. So you would need to move the eBooks from the pocketbook that have DRM into calibre to remove the DRM and then send to device once the DRM is gone.
|
![]() |
![]() |
![]() |
#22 |
0000000000101010
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
It's a workaround for users that have Koreader set as the default ebook reader application. It will override Koreader as the default for .acsm loaded books, opening them instead with the PocketBook reader app, saving the user from Koreader launching just to state it can't open a DRM'd ebook. Koreader remains the default application for all other books.
Last edited by neil_swann80; 11-10-2024 at 01:26 PM. |
![]() |
![]() |
![]() |
#23 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#24 |
0000000000101010
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
|
I'm not sure what you're not understanding here. The in-built PocketBook reader app CAN handle DRM. The workaround in this thread BYPASSES Koreader (if set as the default app) and launches the stock PocketBook reader app instead (for ebooks loaded via .acsm).
|
![]() |
![]() |
![]() |
#25 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 199
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
Quote:
[As for me, if I want to read a DRMd book with koreader, I simply crack it with knock. At times I take the trouble to do, for purely personal use, for instance when it would take me much more than the library lending time to get through it, or when the epub is so poorly formatted that it is unreadable in PB reader. Calibre DeDRM never worked for me] ![]() ![]() ![]() ![]() Last edited by EastEriq; 11-11-2024 at 12:02 PM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOreader as default on Boox Poke 3 | Waylander | KOReader | 4 | 05-22-2021 05:09 PM |
Plato or Koreader by default | stiivo | Kobo Reader | 3 | 07-28-2020 02:39 PM |
eBooks use epub so why am I getting an acsm file? | Atomised | Conversion | 9 | 05-30-2018 04:51 PM |
epub and ocsm (NOT acsm) | clemens14 | ePub | 0 | 12-26-2015 03:07 PM |
How long between dowloading the .acsm and downloading epub? | Mad_Max | ePub | 0 | 01-07-2011 02:18 PM |