Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-11-2016, 12:05 AM   #1
blaenk
Connoisseur
blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.
 
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
force mobi-asin identifier download from amazon source?

So when I download metadata from amazon, sometimes I'll get a regular ASIN and other times I'll get what I believe is called the mobi-asin, the one that begins with the letter 'B'. With the latest kindle firmware 5.7.2, the mobi-asin works better for my uses.

My question is, given that _sometimes_ it'll download the mobi-asin and sometimes it wont, is there a way to prioritize the mobi-asin download? So if it perhaps sees both when it's scraping, it'll use the mobi-asin?
blaenk is offline   Reply With Quote
Old 02-11-2016, 12:36 AM   #2
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What ASIN is downloaded depend on what ASIN is present on the webpage that the data is downloaded from. That's not in calibre's control. Whether you get an ebook asin or not depends on whether the top match that amazon returns is for the kindle edition or not (and remember that some books haveno kindle editions at all).
kovidgoyal is offline   Reply With Quote
Advert
Old 02-11-2016, 03:24 AM   #3
blaenk
Connoisseur
blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.
 
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
Thanks.

I ended up writing a calibre plugin to take the goodreads identifier and directly translate it into the mobi-asin using a private goodreads api I discovered, and then use that to set the amazon identifier to the mobi-asin. It worked perfectly.

While it would be awesome, I doubt we could integrate that into calibre since it seems to be a private api.
blaenk is offline   Reply With Quote
Old 02-11-2016, 04:25 AM   #4
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Incidentally, why do you care which ASIN is returned?
kovidgoyal is offline   Reply With Quote
Old 02-11-2016, 05:00 AM   #5
blaenk
Connoisseur
blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.
 
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
In order to be able to update my reading progress via goodreads integration on a sideloaded book, I have to use the Quality Check plugin to patch-in the mobi-asin. Before Kindle firmware 5.7.2 (which came out a few days ago; I'm on a Paperwhite 3), you could put any ASIN and it would work: paperback, hardcover, whatever. So the fact that calibre just downloads whichever one it finds first was not an issue.

With the recent 5.7.2 firmware, I noticed that now only books that have the kindle ASIN, the ones that start with the letter "B", still work with goodreads integration. So I had to go and change all of the books I had that had the non-kindle ASINs and get the kindle ASINs. So for example, previously it might've been amazon:1491903996 which is the paperback version of a book, and now it had to be amazon:B00PGCMGDQ, the kindle version of the book. I had to re-run the Quality Check plugin to patch-in the kindle ASINs into the mobi-asin fields of each of the azw3/mobi files and resend them all to my device.

Now goodreads integration is working again.

The only remaining unfortunate consequence of this is that: previously, even if a book wasn't available in the kindle store (and thus had no kindle ASIN), you could still get any other ASIN for that book in order to get goodreads integration. Now since it seems to require a kindle ASIN, if the book I have isn't available in the kindle store, it won't have a kindle ASIN, so I won't be able to use the goodreads integration

Last edited by blaenk; 02-11-2016 at 05:03 AM.
blaenk is offline   Reply With Quote
Advert
Old 02-11-2016, 06:12 AM   #6
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Note that if you add an actual kindle book to calibre, it will automatically get the mobi-asin from the added file.

And if you really want to create a plugin to map arbitrary asins to kindle edition asin, you could do it by parsing the amazon page for the book, and looking for the link to the kindle edition on that page. The ebook edition asin can be extracted from the url of that link.
kovidgoyal is offline   Reply With Quote
Old 02-11-2016, 04:15 PM   #7
blaenk
Connoisseur
blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.
 
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
My books aren't from the kindle store.

With respect to your second point, that was what I was asking in my initial post. Are you against exposing this as an option? If we could have a way to _prioritize_ looking for the kindle ASIN if it could find it on the page. If not, then just do what it always does.

If you're against that, I wonder if I could extract the amazon metadata downloader out into a differently named metadata download plugin and modify it to prioritize looking for the kindle ASIN, or otherwise fallback on any of the other ASIN it might have found. This would essentially be a fork though and I would fall behind on any updates/fixes you would introduce to the amazon downloader

So to be clear, the amazon metadata downloader would remain the same except that it would expose an option that tells it to make an attempt to look for the kindle ASIN and return that first.

Correct me if I'm wrong, but it seems like this would be easy. I noticed that whenever you visit an amazon page for a book that has a kindle version, amazon does its best to sell it to you by noting this in a yellow bar on top of the page.

For example: http://www.amazon.com/Mistborn-Final...dp/0765377136/

It says this in a yellow bar at the top:

Quote:
Mistborn: The Final Empire and over one million other books are available for Amazon Kindle. Learn more
At CSS Selector location:

Code:
.goKindleStaticPopDiv a
The href of this link contains the kindle ASIN:

Code:
http://www.amazon.com/Mistborn-Final-Empire-Brandon-Sanderson-ebook/dp/B002GYI9C4/ref=dp_kinw_strp_1
I confirmed that this is there even from a simple GET; it doesn't depend on any javascript.

So if we did add this option to the amazon downloader, it would simply see if that link existed on the page and if so it would parse out the ASIN, which in this case is B002GYI9C4. Would you be against such a feature? It seems ripe for the taking. I don't care if it's off by default really. I would appreciate it immensely.

The reason I did it the way I did it right now is that I already had goodreads ids for them and goodreads, being an amazon subsidiary, also has an incentive to link to the kindle book, so I found that as a means to short-circuit the work. All I had to do was send the goodreads id to the private goodreads api and I got back the kindle ASIN in the returned json. Beats scraping IMO.
blaenk is offline   Reply With Quote
Old 02-11-2016, 10:34 PM   #8
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont want to prioritize kindle editions, it sometimes happens that they have inferior metadata compared to the pages for the paper books. Instead, I prefer to do an unbiased search and use whatever result amazon thinks is the best.

And generally speaking, I dont like the idea of inserting genuine asins into files that are not from Amazon, since, IMO this is an abuse of the intended operation of the system and could lead to hard to debug issues with cloud syncing since the sync code probably relies on all versions of the files being identical or close to identical.

But you are welcome to create your own amazon plugin based on the builtin one that does whatever you like, it should be a fairly trivial modification, and the builtin plugin is contained in a single file, you can just copy paste it into your plugin (sources/amazon.py)
kovidgoyal is offline   Reply With Quote
Old 02-11-2016, 10:58 PM   #9
blaenk
Connoisseur
blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.blaenk 's ceiling is 100% spider-free.
 
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
Ah fair enough. I personally don't use the cloud sync feature precisely for that reason, because I know my book is sideloaded so I presumed it wouldn't even work. I only insert genuine ASINs because the goodreads progress update integration is pretty useful. The interesting thing though is that sharing quotes via goodreads doesn't work---the "share" option is grayed out.

I guess I'll just extract the built-in downloader into my own plugin as a fork then.

Thanks for creating Calibre!
blaenk is offline   Reply With Quote
Old 02-12-2016, 07:44 AM   #10
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,497
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by blaenk View Post
I guess I'll just extract the built-in downloader into my own plugin as a fork then.
I also prefer to have ASINs that refer to the Kindle edition when possible.

If you do come up with a forked plugin would you post it for others to use?
jhowell is offline   Reply With Quote
Old 06-20-2016, 02:15 AM   #11
restinginlove
Enthusiast
restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.restinginlove can teach chickens to fly.
 
Posts: 30
Karma: 3678
Join Date: Nov 2015
Location: Colorado
Device: Kobo Glo HD, Clara HD
Quote:
Originally Posted by jhowell View Post
I also prefer to have ASINs that refer to the Kindle edition when possible.

If you do come up with a forked plugin would you post it for others to use?
De-lurking to second this! I just searched the forums trying to see if there was an easy way to get the kindle ASIN in calibre (as even the goodreads plugin in calibre seems to be broken now) and it looks like there isn't at this time Good to know there is a workaround (manually pulling it from the amazon page and inputting it) at least!
restinginlove is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download options for Identifier (isbn, asin, etc.) metadata digital_carver Library Management 14 09-06-2015 08:35 PM
Download metadata from ASIN CaitlinShaw Library Management 3 06-17-2015 12:56 AM
Difference between mobi-asin and amazon? MelBr Library Management 1 03-30-2013 12:05 AM
how to get mobi-asin:B0xx into book.mobi - exth 113 gggggg Conversion 4 03-25-2013 09:14 PM
What happens when MOBI matches actual ASIN in Amazon's database? Zero9 Conversion 0 05-29-2011 10:20 AM


All times are GMT -4. The time now is 02:58 PM.


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