Mobileread
[Device Plugin] Kobo Touch Extended Driver
#1921  davidfor 08-02-2019, 10:40 PM
Quote lumpynose
What's with the "Failed to find obfuscation key" error?

I ran Polish books on all of my books and this error came up with some books I'd bought from Amazon. Searching gave me the solution to do an EPUB -> EPUB conversion and then they transferred.

In the future should I avoid running Polish books on EPUBs that have been converted from Amazon purchases or does it not matter and I can jump through the extra hoops by doing the conversion?
Sorry, I don't know. My memory, says the error is related to an internal font. They can be obfuscated and the key is in the file. But, I would have thought the initial conversion would have handled this. Or that Polish would, but might be depended on the options. But, if it needs another conversion step, you might need to accept that it is needed.
Quote
Edit: I think I may be confused; I may not have previously uploaded these converted books with the Extended Driver. So maybe the error wasn't due to Polish books?
Again, I don't know. You probably need to experiment and check.
Reply 

#1922  lumpynose 08-02-2019, 10:48 PM
Quote davidfor
Sorry, I don't know. My memory, says the error is related to an internal font. They can be obfuscated and the key is in the file. But, I would have thought the initial conversion would have handled this. Or that Polish would, but might be depended on the options. But, if it needs another conversion step, you might need to accept that it is needed.


Again, I don't know. You probably need to experiment and check.
Yes, sorry, it's due to an obfuscated embedded font.
Reply 

#1923  lumpynose 08-03-2019, 04:00 PM
This problem exists with both this driver and the plain Touch driver.

In the driver settings in the Collections, covers & uploads tab I have Modify CSS checked. In the kobo_extra.css file on the kobo I have

PHP Code
{
    
text-alignleft !important;

When I upload a book to the Kobo (Forma, latest firmware) and then look at it, it's as if some or all of the formatting has been removed. Paragraphs no longer have the indent that's specified in the book's stylesheet and have a blank line between them, h2 tags are no longer centered, etc.

If I remove the kobo_extra.css from the Kobo and add that line to the bottom of the book's stylesheet then everything works as expected.

This happens with both books I've made as well as books downloaded from Project Gutenberg.

Edit: I forgot to say that with the !important removed then it works as expected.
Reply 

#1924  jackie_w 08-03-2019, 04:14 PM
Quote lumpynose
This problem exists with both this driver and the plain Touch driver.

In the driver settings in the Collections, covers & uploads tab I have Modify CSS checked. In the kobo_extra.css file on the kobo I have

PHP Code
{
    
text-alignleft !important;

When I upload a book to the Kobo (Forma, latest firmware) and then look at it, it's as if some or all of the formatting has been removed. Paragraphs no longer have the indent that's specified in the book's stylesheet and have a blank line between them, h2 tags are no longer centered, etc.

If I remove the kobo_extra.css from the Kobo and add that line to the bottom of the book's stylesheet then everything works as expected.

This happens with both books I've made as well as books downloaded from Project Gutenberg.
I'm not sure this is going to be any help to you but I've seen this before when the !important attribute is used in CSS. I'm afraid I never got to the bottom of the finer points of why/how the CSS gets wrecked.

As a result, long ago, I decided to ban the use of !important inside any of my own epubs or in kobo_extra.css. I haven't had any problems since.
Reply 

#1925  lumpynose 08-03-2019, 04:19 PM
Quote jackie_w
I'm not sure this is going to be any help to you but I've seen this before when the !important attribute is used in CSS. I'm afraid I never got to the bottom of the finer points of why/how the CSS gets wrecked.

As a result, long ago, I decided to ban the use of !important inside any of my own epubs or in kobo_extra.css. I haven't had any problems since.
Waah! I need it in order to override some CSS that has higher precedence. This seemed like a nice generic way for all books.

I can't remember what the book was using that made it hard to override. Are there other ways of overriding besides !important?
Reply 

#1926  jackie_w 08-03-2019, 04:54 PM
Quote lumpynose
Waah! I need it in order to override some CSS that has higher precedence. This seemed like a nice generic way for all books.

I can't remember what the book was using that made it hard to override. Are there other ways of overriding besides !important?
!important seems to work OK as part of the firmware's default override CSS files for epub and kepub. So, if you're using the kobopatch system, you might be able to do it with a customised patch. For example, you could try customising the patch called 'Un-Force user text-align in div,p tags in KePubs' if you wanted to force alignment in all kepubs.

The default kepub override CSS is:
Code
div, p { text-align: %1 !important; }
Changing that to:
Code
div, p {text-align: left !important;}
or some other variation of your choice. (Note: You must keep the before/after string lengths the same.)

However, be aware that this would stop the alignment buttons in the Kobo's [Aa] menu working for kepubs. Only experimenting will tell you whether it actually does what you want.
Reply 

#1927  lumpynose 08-03-2019, 05:16 PM
Ok, thanks jackie_w.
Reply 

#1928  Urdu 08-03-2019, 09:59 PM
I use the latest Kobo ext driver version. Still I can't transfer books to my Kobo?

calibre, version 3.46.0
FOUT: Fout: Fout bij communicatie met apparaat

Error communicating with device

'NoneType' object has no attribute 'startswith'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 89, in run
File "site-packages/calibre/gui2/device.py", line 593, in _upload_books
File "calibre_plugins.kobotouch_extended.device.driver" , line 399, in upload_books
File "site-packages/calibre/devices/kobo/driver.py", line 2087, in upload_books
File "calibre_plugins.kobotouch_extended.device.driver" , line 313, in _modify_epub
File "lib/python2.7/posixpath.py", line 254, in expanduser
AttributeError: 'NoneType' object has no attribute 'startswith'
Reply 

#1929  davidfor 08-03-2019, 10:24 PM
Quote Urdu
I use the latest Kobo ext driver version. Still I can't transfer books to my Kobo?

calibre, version 3.46.0
FOUT: Fout: Fout bij communicatie met apparaat

Error communicating with device

'NoneType' object has no attribute 'startswith'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 89, in run
File "site-packages/calibre/gui2/device.py", line 593, in _upload_books
File "calibre_plugins.kobotouch_extended.device.driver" , line 399, in upload_books
File "site-packages/calibre/devices/kobo/driver.py", line 2087, in upload_books
File "calibre_plugins.kobotouch_extended.device.driver" , line 313, in _modify_epub
File "lib/python2.7/posixpath.py", line 254, in expanduser
AttributeError: 'NoneType' object has no attribute 'startswith'
I didn't think that was possible with the last set of changes in the driver. Removing the file "device_drivers_KOBOTOUCHEXTENDED.py.json" from the configuration directory will probably fix it. But, you might need to remove "device_drivers_KOBOTOUCHEXTENDED.py" as well and do the configuration from scratch.
Reply 

#1930  Urdu 08-03-2019, 11:03 PM
Quote davidfor
I didn't think that was possible with the last set of changes in the driver. Removing the file "device_drivers_KOBOTOUCHEXTENDED.py.json" from the configuration directory will probably fix it. But, you might need to remove "device_drivers_KOBOTOUCHEXTENDED.py" as well and do the configuration from scratch.
Had to remove both. Now it works. Thanks David!
Reply 

 « First  « Prev Next »  Last »  (193/231)
Today's Posts | Search this Thread | Login | Register