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.