Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2024, 08:29 AM   #16
EastEriq
Groupie
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
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
Second, I modified these lines of extensions.cfg:
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
and removed my previous attempts of writing there a line for acsm:@ACSM_file:1.

Now what happens when I tap on an .acsm file is the following:
  1. the full book is downloaded, while the icon in the librarian shows an animation with the progressing percentage;
  2. the resulting epub or pdf is created in /mnt/ext1/Digital Editions (in contrast to what I wrote above, not in the same dir as the .acsm)
  3. the dialog asking which program to use comes up
  4. the book opens in the reader chosen
After that, the association becomes permanent, because it is written in handlers.cfg. The fact that the new line is initially appended at its end doesn't seem to create problems, the file is subsequently reordered alphabetically by the OS.

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.
EastEriq is offline   Reply With Quote
Old 11-08-2024, 11:29 PM   #17
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
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
I've found you need to specify the path for the eink-reader.app file specifically within /ebrmain/cramfs/bin otherwise the Darkmode state is not respected. Same for dialog.

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.
neil_swann80 is offline   Reply With Quote
Old 11-09-2024, 02:50 PM   #18
EastEriq
Groupie
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 199
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Quote:
Originally Posted by neil_swann80 View Post
Seems like you only need to trigger user input if the "Digital Editions" directory is where the book is being opened from.
Yes, I also thought that. I was under the impression that the acsm are resolved in their same directory; but that was only true as long as I used to place them in "Digital Editions".

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:
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.
I could argue that there are also social DRM books which I get via acsm, knowing a priori given their publisher that koreader opens them, but that is academic. I'd see after some use if I prefer the question for every new book, or what.
EastEriq is offline   Reply With Quote
Old 11-09-2024, 05:24 PM   #19
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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.
JSWolf is offline   Reply With Quote
Old 11-10-2024, 01:23 AM   #20
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
Quote:
Originally Posted by JSWolf View Post
The problem is that when you get a .acsm results in an ePub with DRM. KOReader cannot read an ePub with DRM.
Indeed. The scripts in this thread are meant as a workaround to automate the handling of that very issue.
neil_swann80 is offline   Reply With Quote
Old 11-10-2024, 01:04 PM   #21
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by neil_swann80 View Post
Indeed. The scripts in this thread are meant as a workaround to automate the handling of that very issue.
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.
JSWolf is offline   Reply With Quote
Old 11-10-2024, 01:17 PM   #22
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
Quote:
Originally Posted by JSWolf View Post
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.
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.
neil_swann80 is offline   Reply With Quote
Old 11-11-2024, 04:29 AM   #23
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by neil_swann80 View Post
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.
KOReader cannot display eBooks with DRM. So there is no point in loading eBooks from .acsm on the Pocketbook. You are better off doing it on the computer where you can remove the DRM and then load the eBooks on the Pocketbook for KoReader.
JSWolf is offline   Reply With Quote
Old 11-11-2024, 04:37 AM   #24
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,891
Karma: 12981955
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
Quote:
Originally Posted by JSWolf View Post
KOReader cannot display eBooks with DRM. So there is no point in loading eBooks from .acsm on the Pocketbook. You are better off doing it on the computer where you can remove the DRM and then load the eBooks on the Pocketbook for KoReader.
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).
neil_swann80 is offline   Reply With Quote
Old 11-11-2024, 04:48 AM   #25
EastEriq
Groupie
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 199
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Quote:
Originally Posted by JSWolf View Post
So there is no point in loading eBooks from .acsm on the Pocketbook.
Factually, that's wrong. Anyway, sorry, you don't seem to get what is discussed in this thread. For which both me and neil_swann80 have provided solutions.

[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.
EastEriq is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:56 PM.


MobileRead.com is a privately owned, operated and funded community.