02-06-2012, 01:23 PM | #1 |
Guru
Posts: 927
Karma: 2143512
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
|
Programmatically detecting B&N DRM in books
The ePub QuickLook generator for Macs at https://github.com/jaketmp/ePub-quicklook has some (currently unreleased) code which tries a few heuristics to guess the DRM being used in a given book.
It works reasonably well so far for Adobe, Apple and Kobo DRM - the only examples I've got. The heuristics are currently in the code at https://github.com/jaketmp/ePub-quic...JTPepub.m#L495 for anyone interested. I'm certain it isn't perfect... According to the wiki here, B&N have another DRM scheme. It'd be nice to be able to detect that DRM too, but B&N don't sell to the UK so I can't see what they do. Can anyone offer any suggestions (or sample books!) showing what B&N's DRM looks like? We don't have to/want to decrypt it, just work out that it is from B&N. |
02-06-2012, 03:10 PM | #2 | |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Distinguishing between the two may prove difficult programmatically. Possibly take a look at the "operatorUrl" element of the rights.xml file (which they both have—and it's in the same format). I can't swear that all B&N books have the exact same url listed for that element, but barnesandnoble.com seems to be somewhere in there in the examples I have. I know the regular Adobe epubs can have all kinds different fulfillment urls in that "operatorURL" element. Good luck! EDIT: Taking a quick peek at your code... yes.... you're currently including B&N books right along with the rest of the Adept DRM, since both will match: Code:
// Adobe Adept DRM has "META-INF/rights.xml", containing <licenseURL> with an adobe.com URL. Last edited by DiapDealer; 02-06-2012 at 03:27 PM. |
|
02-06-2012, 03:38 PM | #3 | |
Guru
Posts: 927
Karma: 2143512
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
|
Quote:
|
|
02-06-2012, 03:56 PM | #4 | |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
If the licenseURL contains "adobe.com", it's definitely ADEPT encryption. AND if the operatorURL contains "barnsandnoble.com", it's more than likely a B&N DRMed book. I'd be very hesitant to rely on any of that straight across the board, though. |
|
02-06-2012, 04:28 PM | #5 | |
Guru
Posts: 927
Karma: 2143512
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
|
Quote:
A book I bought that's definitely Adept has: <licenseURL>https://nasigningservice.adobe.com/licensesign</licenseURL> <operatorURL>http://acs4.shortcovers.com:8080/fulfillment</operatorURL> If we've got something with operatorURL in the adobe namespace, the odds are that it is either B&N or Adobe. (Or someone I haven't heard of yet.) So I think just checking for barnesandnoble may be "good enough" at least for now. Hm. I wonder what Overdrive books look like... |
|
02-06-2012, 07:44 PM | #6 |
Evangelist
Posts: 416
Karma: 14682
Join Date: May 2008
Location: SF Bay Area
Device: Nook HD, Nook for Windows 8
|
DRM is always undocumented.... jeez We use a particular variant of Adobe DRM ('Passhash') that nobody else has picked up... yet.
If you want to know which variant of Adobe DRM then: rights->licenseToken->user will not exist with Passhash based DRM (that we use for Trade), but will with ACS4 Classic licenses (that we use for Education). If you want to know where you got the book from then operatorURL is your best bet f, but if the back end server is in a middle man role this won't work as well. For instance a book that I get from the San Jose Public Library will have an Overdrive or NetLibrary operatorURL, and not a San Jose Public Library URL. (There are similar arrangements for purchasing). |
02-06-2012, 07:44 PM | #7 | |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
02-07-2012, 02:52 AM | #8 | ||
Guru
Posts: 927
Karma: 2143512
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
|
Quote:
Quote:
Another thought. Do the adept:certificate elements in B&N books still have an X.509 certificate? The ones in the Adept DRMed books I've got here all seem to, and have a subject name of "cn=https://nasigningservice.adobe.com/licenses,ou=Digital Publishing,o=Adobe Systems Incorporated,c=US" I just grabbed a book from our local (Overdrive) library and it had: <licenseURL>https://nasigningservice.adobe.com/licensesign</licenseURL> <operatorURL>http://acsepub.contentreserve.com/fulfillment</operatorURL> (and the same Adobe X.509 certificate) Nothing really useful there... But the permissions>display>loan/until elements might be another interesting thing to display. |
||
02-07-2012, 08:07 AM | #9 | |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
02-07-2012, 01:06 PM | #10 |
Evangelist
Posts: 416
Karma: 14682
Join Date: May 2008
Location: SF Bay Area
Device: Nook HD, Nook for Windows 8
|
Some documentation is provided to those that Adobe thinks has a need to know (ACS4/RMSDK customers). I can't give you a copy, since they are provided (to me at least) under NDA. There may be people who are either less fastidious than me about their NDAs, or who didn't get the documentation under the same agreements, so good luck on your search.
|
02-09-2012, 03:24 PM | #11 | |
Guru
Posts: 927
Karma: 2143512
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
|
Quote:
Thanks greatly for the snippets you've mentioned in this thread! |
|
02-10-2012, 10:38 AM | #12 | ||
Evangelist
Posts: 416
Karma: 14682
Join Date: May 2008
Location: SF Bay Area
Device: Nook HD, Nook for Windows 8
|
Quote:
regarding an earlier question. Quote:
/JOKE: However, please don't take my word for it. I suggest you go buy as much content as possible from Barnes & Noble to make sure I'm right /JOKE. |
||
02-11-2012, 02:12 PM | #13 |
Guru
Posts: 927
Karma: 2143512
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
|
When are Barnes & Noble going to sell to UK readers?
|
02-14-2012, 01:10 AM | #14 |
Evangelist
Posts: 416
Karma: 14682
Join Date: May 2008
Location: SF Bay Area
Device: Nook HD, Nook for Windows 8
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Touch Not detecting books in main memory | Nalj | Kobo Reader | 12 | 08-11-2011 07:11 PM |
PRS-600 Programmatically handling collections | wakata | Sony Reader Dev Corner | 1 | 07-10-2011 06:19 PM |
Detecting complete sync of books from device | meme | Development | 19 | 04-19-2011 03:27 PM |
2 Free books (DRM-free PDF) - To Tame a Duke & Fool's Gold [Romance & Mystery] | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 03-07-2011 10:41 PM |
Classic B&N books and DRM | Care | Barnes & Noble NOOK | 3 | 08-09-2010 11:06 PM |