Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 07-18-2017, 01:38 PM   #1216
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes, the bug is in mobi_html.py where we explicitly look for url( style pieces in the css but do not handle that case:

Code:
url_pattern = re.compile(br'''(url\(.*?\))''', re.IGNORECASE)

url_img_index_pattern = re.compile(br'''[('"]kindle:embed:([0-9|A-V]+)\?mime=image/[^\)]*["')]''', re.IGNORECASE)

font_index_pattern = re.compile(br'''[('"]kindle:embed:([0-9|A-V]+)["')]''', re.IGNORECASE)

url_css_index_pattern = re.compile(br'''kindle:flow:([0-9|A-V]+)\?mime=text/css[^\)]*''', re.IGNORECASE)
I will try to use your example see how to best to handle the missing case of a kindle:flow but with a mime=image/svg+xml.

I think we can easily handle it as a special case by adding a:

url_svg_image_pattern = re.compile(br'''kindle:flow:([0-9|A-V]+)\?mime=image/svg+xml[^\)]*''', re.IGNORECASE)

and then handling it just like we handle inlined css flow urls.

Thanks,

KevinH

Last edited by KevinH; 07-18-2017 at 01:45 PM.
KevinH is offline   Reply With Quote
Old 07-18-2017, 02:00 PM   #1217
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
Should be fixed with this commit:

https://github.com/kevinhendricks/Ki...f6bdbf29157b61

Thank you for the bug report and wonderfully simple testcase!
KevinH is offline   Reply With Quote
Advert
Old 07-18-2017, 02:07 PM   #1218
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by KevinH View Post
When you say round-tripped to Mobi are you referring to just an azw3 or to just an older .mobi (mobi 6) format or to the the joint mobi format (with both azw3 and mobi6 versions) or something else?
I used kindlegen v2.9 to create a dual mobi/kf8 file then I used kindleunpack to decode it. The style css file created in the mobi8/OEBPS/Styles directory shows the problem.
jhowell is online now   Reply With Quote
Old 07-18-2017, 02:19 PM   #1219
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by KevinH View Post
Should be fixed with this commit...
I tried it and it works for me. Thanks!
jhowell is online now   Reply With Quote
Old 08-13-2017, 03:51 PM   #1220
timofonic
Zealot
timofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic something
 
Posts: 123
Karma: 18554
Join Date: Jan 2008
Location: Spain
Device: Onyx Boox M96+
Oh. It's great to see KindleUnpack is still alive. Thanks a lot!
timofonic is offline   Reply With Quote
Advert
Old 03-06-2018, 12:19 PM   #1221
raoni.kachille
Junior Member
raoni.kachille began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2018
Device: Kindle
hello im trying to use the program in the comand line and it gives this following error message

(i was trying to use the gui and was getting a error message, then i tried to use directly from the cmd, like the readme tells and this message appeared.)

File "kindleunpack.py", line 1016, in <module>
sys.exit(main())
File "kindleunpack.py", line 992, in main
infile, outdir = args
ValueError: too many values to unpack (expected 2)
raoni.kachille is offline   Reply With Quote
Old 03-06-2018, 12:21 PM   #1222
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,496
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
The command takes two arguments. The file to unpack and the directory to unpack it into. You seem to be giving it more than two arguments, but you haven't given the command you issued, so exactly what's wrong is a mystery.
pdurrant is offline   Reply With Quote
Old 03-06-2018, 03:11 PM   #1223
AcidWeb
KCC Co-Author
AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.
 
AcidWeb's Avatar
 
Posts: 845
Karma: 765434
Join Date: Mar 2013
Location: Poland
Device: Kindle Oasis 2
There is some new header field (or other black magic) that decide if book with field 501 = EBOK should be put in Comics not Books category.

None of known comics related fields (122, 123, 127, 128) do that. And no known configuration of EPUB trigger this categorization - Syntax in accordance with Amazon Publishing Guidelines is not enough.

Last edited by AcidWeb; 03-06-2018 at 03:16 PM.
AcidWeb is offline   Reply With Quote
Old 03-06-2018, 04:09 PM   #1224
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by pdurrant View Post
The command takes two arguments. The file to unpack and the directory to unpack it into. You seem to be giving it more than two arguments, but you haven't given the command you issued, so exactly what's wrong is a mystery.
In Linux he might have entered a wild card.

Dale
DaleDe is offline   Reply With Quote
Old 03-07-2018, 12:16 AM   #1225
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by AcidWeb View Post
There is some new header field (or other black magic) that decide if book with field 501 = EBOK should be put in Comics not Books category.
My best guess is that the "comic" category is not determined by the book contents, but comes from Amazon's servers.

As a test I put my Oasis in airplane mode, bought a (free) comic, downloaded it and copied it to the Oasis via USB. It did not show as a comic. I then turned off airplane mode and synced the kindle. After that the sideloaded book showed as a comic.

As another test I took a book that showed as a comic and made a copy of it with a different (unused) ASIN. The copy did not show as a comic even though the book contents were identical to the original book, other than the ASIN.
jhowell is online now   Reply With Quote
Old 03-07-2018, 02:55 AM   #1226
AcidWeb
KCC Co-Author
AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.
 
AcidWeb's Avatar
 
Posts: 845
Karma: 765434
Join Date: Mar 2013
Location: Poland
Device: Kindle Oasis 2
Quote:
Originally Posted by jhowell View Post
My best guess is that the "comic" category is not determined by the book contents, but comes from Amazon's servers.

As a test I put my Oasis in airplane mode, bought a (free) comic, downloaded it and copied it to the Oasis via USB. It did not show as a comic. I then turned off airplane mode and synced the kindle. After that the sideloaded book showed as a comic.

As another test I took a book that showed as a comic and made a copy of it with a different (unused) ASIN. The copy did not show as a comic even though the book contents were identical to the original book, other than the ASIN.
You are right. Sync is editing p_type column in cc.Entries internal database: Entry:Item -> Entry:Item:Comic

Well played Amazon. Forcing remote query to check information that is available in file header.

Last edited by AcidWeb; 03-07-2018 at 03:01 AM.
AcidWeb is offline   Reply With Quote
Old 03-07-2018, 03:20 AM   #1227
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by AcidWeb View Post
Well played Amazon. Forcing remote query to check information that is available in file header.
Amazon has been doing that for years. The earliest example, I can remember is when they refused to display thumbnails for books unless the thumbnails are downloaded from Amazon even though the files have perfectly good thumbnails in their metadata, this was back in 2010-2011 IIRC

Amazon has been gradually trying to make side-loading less and less pleasant on their platforms for a very long time.
kovidgoyal is offline   Reply With Quote
Old 03-07-2018, 03:24 AM   #1228
AcidWeb
KCC Co-Author
AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.
 
AcidWeb's Avatar
 
Posts: 845
Karma: 765434
Join Date: Mar 2013
Location: Poland
Device: Kindle Oasis 2
Yeah. It is infuriating.
AcidWeb is offline   Reply With Quote
Old 09-29-2018, 11:52 AM   #1229
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
For my own use, I am considering adding a global variable named VERBOSITY (or similar) to KindleUnpack and putting some or most print statements in
Code:
if VERBOSITY>0:
blocks and adding -q and -v options. Each -q would decrement VERBOSITY and each -v would increment it. (Various blocks might use values other than 0.)

I think this would be generally useful and am curious what others think about this.

Should I open an issue on github with a similar message to discuss this?
j.p.s is online now   Reply With Quote
Old 09-29-2018, 05:15 PM   #1230
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
So long as none of the various entry point functions' parameter numbers/orders are altered (there are several existing plugins and wrapper programs that use KindleUnpack pieces via import), feel free to submit a pull request on github. But we can discuss it here, I think.

I think most of the people still using the standalone version of KindleUnpack are probably using it for debugging problematic Kindlebooks. So they tend to want as much output as possible for that purpose. For those using the various plugin-ized versions of KindleUnpack, the debug output doesn't really matter anyway.

I'm not opposed to the idea. I just don't know how utilized it would be. I always want to see all the print statements when I use kindleunpack from the command line. Needing to see everything is frankly why I'd be using the standalone version of KU from the command-line in the first place.

Last edited by DiapDealer; 09-29-2018 at 05:20 PM.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i rotate text and insert images in Mobi and EPUB? JanGLi Kindle Formats 5 02-02-2013 04:16 PM
PDF to Mobi with text and images pocketsprocket Kindle Formats 7 05-21-2012 07:06 AM
Mobi files - images DWC Introduce Yourself 5 07-06-2011 01:43 AM
pdf to mobi... creating images rather than text Dumhed Calibre 5 11-06-2010 12:08 PM
Transfer of images on text files anirudh215 PDF 2 06-22-2009 09:28 AM


All times are GMT -4. The time now is 06:20 PM.


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