![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Sep 2011
Device: iPad
|
Calibre ASIN support in ".mobi" output
I was trying to get cross-device sync to work with the epubs that I bought from B&N and converted to .mobi.
It was not working with the UUID that is generated/created by default. So, I modified "calibre/src/calibre/ebooks/mobi/writer2/main.py" I modified the ASIN set block to look like this: Code:
# Write UUID as ASIN uuid = None from calibre.ebooks.oeb.base import OPF for x in oeb.metadata['identifier']: if x.get(OPF('scheme'), None).lower() == 'asin' or unicode(x).startswith('urn:asin:'): uuid = unicode(x).split(':')[-1] break if x.get(OPF('scheme'), None).lower() == 'amazon' or unicode(x).startswith('urn:amazon:'): uuid = unicode(x).split(':')[-1] break if uuid is None: for x in oeb.metadata['identifier']: if x.get(OPF('scheme'), None).lower() == 'uuid' or unicode(x).startswith('urn:uuid:'): uuid = unicode(x).split(':')[-1] break if isinstance(uuid, unicode): uuid = uuid.encode('utf-8') if not self.opts.share_not_sync: exth.write(pack(b'>II', 113, len(uuid) + 8)) exth.write(uuid) nrecs += 1 This feature only works if an ASIN has been set on the ebook. Feedback welcome! (I've never done python before I just made this work because I wanted the feature. I wanted to share it here in case other people needed it.) |
![]() |
![]() |
![]() |
#2 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
What difficulties did you experience trying to sync? |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Sep 2011
Device: iPad
|
I put the same book (same UUID as ASIN... I checked with Mobi2Mobi) on my iPhone Kindle App and on my Android Kindle App... and could not get them to sync at all.
Note: this procedure doesn't appear to change that. So I guess my code doesn't do anything anyway. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,188
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is a long thread with discussions of this feature and its caveats in this forum. As far as I know, as long as you have the sync not share checkbox checked in the MOBI output options and you send the mobi files to your devices directly (i.e. not via amazon email) the feature works.
|
![]() |
![]() |
![]() |
#5 | ||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Quote:
Last edited by DoctorOhh; 11-14-2011 at 10:57 PM. |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Sep 2011
Device: iPad
|
The "Enable sharing of book content" checkbox? I've got it unchecked.
http://imgur.com/bNdkd It says that checking it will disable sharing. I must have been reading out of date information however on how ASIN numbers are used to sync. I've not got either option to work. I use sideloading to the SD Card on the Android device, copy to My Documents on the kindle desktop app, and direct mobi download from content server on the iOS device. Couldn't get it to work. I'm not here for support though, I can do more reading if the code is useless. |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Sep 2011
Device: iPad
|
I don't have a Kindle 3 and the iOS app doesn't have a "Sync to Furthest Read" button on the phone.
Maybe it just doesn't work that way. |
![]() |
![]() |
![]() |
#8 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,188
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Having it unchecked is fine. I didn't recall which way the checkbox was written as share not sync or sync not share
![]() |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Sep 2011
Device: iPad
|
Oh, the code works. It doesn't help though.
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,188
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Can't help with that, as I've never actually used this feature, myself.
|
![]() |
![]() |
![]() |
#12 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Sep 2011
Device: iPad
|
I'll see if I can dig up the old thread. Just wanted to leave this code out here. It's probably not the best way to get it to work (two loops and all) but it can serve as an example of how to work it in to the writer if anyone else wants to experiment.
Python is not even in my usual language group so... yea. If anyone else has thoughts... let me know. |
![]() |
![]() |
![]() |
#13 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85
Karma: 11090
Join Date: Sep 2008
Device: Kindle, iPhone
|
I've tried putting a calibre generated mobi on two Kindles and an iPad. I loaded both Kindles through calibre and copied the exact file from one of the kindles onto the iPad through the kindle app file sharing section in iTunes. I also verified that there was a GUID in the ASIN metadata field using Mobi2MobiGUI.
The Kindles sync properly. The iPad doesn't. I also tried loading the same file through dropbox and it still didn't work. Books purchased through Amazon do sync, so it isn't that the feature is completely missing on the iPad. There must be something else going on. Has anyone been able to get this working with the Kindle app on an iPad? |
![]() |
![]() |
![]() |
#14 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 32
Karma: 80378
Join Date: Nov 2011
Device: iPad 3, Nexus 7 (2013)
|
Quote:
I appreciate Kovid's stance on writing Amazon ASINs as opposed to using a UUID, but my preference is to use Amazon's ASINs if possible. To date I've been using mobi2mobi to set ASINs to the Amazon one if the calibre UUID isn't sufficient for me, then iExplorer to actually copy the files to the iPad. For my Kindle Fire and Android phones I just put the files in the right directory. My nerdvana would be to have calibre write the Amazon ASIN for me, even if I have to use iExplorer to make sure the files don't get re-worked by iTunes. I'm toying around with letting that be my first foray into calibre plugin creation. I figure it would be nice to have some type of plugin to set the ASIN, either by looking it up or grabbing it from a custom attribute. H.B. |
|
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Nov 2011
Device: iPhone Kindle App
|
H.B. I've gone through and done what you've explained above but still am not able to get the "Book Extras" to appear on the iPhone Kindle App for .mobi files I've manually uploaded via iExplorer.
To me, the Book Extras feature tremendously enhances my reading experience and am quite desperate to obtain this feature for epub/mobi files I have purchased outside of the Kindle marketplace. Do you have any further advice or more specific instructions I could follow to properly add the ASIN number to my files so the iPhone Kindle App will recognize the file and associate the Book Extras from Shelfari? Thank you!!!! |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Calibre to make doc -> mobi files. Problems with "start reading" section. | Stodder | Calibre | 0 | 07-03-2011 10:32 AM |
eopub output: omit "lang=XX" | miwie | Recipes | 1 | 11-18-2010 05:16 PM |
Getting calibre to detect "Prologue" and "Epilogue" for TOC | sherman | Calibre | 2 | 09-20-2010 02:21 AM |
Calibre doesn't support ".doc" files? | megacoupe | Calibre | 11 | 11-13-2009 03:38 AM |