Created
February 2, 2022 16:52
-
-
Save io7m/38a2eb44f8562af5f995dceff07dd7d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Initial DRM schemes and content types in database order: | |
``` | |
[ | |
{ | |
"drm": "application/vnd.adobe.adept+xml", | |
"type": "application/epub+zip" | |
}, | |
{ | |
"drm": "Libby DRM", | |
"type": "application/vnd.overdrive.circulation.api+json;profile=audiobook" | |
}, | |
{ | |
"type": "application/audiobook+json" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.bearer-token+json", | |
"type": "application/pdf" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.bearer-token+json", | |
"type": "application/epub+zip" | |
}, | |
{ | |
"type": "application/epub+zip" | |
}, | |
{ | |
"type": "application/pdf" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.findaway.license+json" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.bearer-token+json", | |
"type": "application/audiobook+json" | |
}, | |
{ | |
"type": "application/kepub+zip" | |
}, | |
{ | |
"type": "application/x-mobipocket-ebook" | |
}, | |
{ | |
"type": "application/x-mobi8-ebook" | |
}, | |
{ | |
"type": "text/plain; charset=utf-8" | |
}, | |
{ | |
"type": "application/octet-stream" | |
}, | |
{ | |
"type": "text/html; charset=utf-8" | |
}, | |
{ | |
"drm": "http://www.feedbooks.com/audiobooks/access-restriction", | |
"type": "application/audiobook+json" | |
}, | |
{ | |
"drm": "application/vnd.readium.lcp.license.v1.0+json", | |
"type": "application/audiobook+lcp" | |
}, | |
{ | |
"drm": "application/vnd.readium.lcp.license.v1.0+json", | |
"type": "application/epub+zip" | |
} | |
] | |
``` | |
We then specify that we want this DRM and content type configuration: | |
``` | |
FormatPriorities( | |
prioritized_drm_schemes=[ | |
"application/vnd.readium.lcp.license.v1.0+json", | |
"application/vnd.librarysimplified.bearer-token+json", | |
"application/vnd.adobe.adept+xml", | |
], | |
prioritized_content_types=[ | |
"application/epub+zip", | |
"application/audiobook+json", | |
"application/audiobook+lcp" | |
"application/pdf", | |
], | |
hidden_content_types=[ | |
"application/x-mobipocket-ebook", | |
"application/x-mobi8-ebook", | |
"application/kepub+zip", | |
"text/plain; charset=utf-8", | |
"application/octet-stream", | |
"text/html; charset=utf-8" | |
], | |
) | |
``` | |
After filtering and prioritization: | |
``` | |
[ | |
{ | |
"type": "application/epub+zip" | |
}, | |
{ | |
"type": "application/audiobook+json" | |
}, | |
{ | |
"type": "application/pdf" | |
}, | |
{ | |
"drm": "application/vnd.readium.lcp.license.v1.0+json", | |
"type": "application/epub+zip" | |
}, | |
{ | |
"drm": "application/vnd.readium.lcp.license.v1.0+json", | |
"type": "application/audiobook+lcp" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.bearer-token+json", | |
"type": "application/epub+zip" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.bearer-token+json", | |
"type": "application/audiobook+json" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.bearer-token+json", | |
"type": "application/pdf" | |
}, | |
{ | |
"drm": "application/vnd.adobe.adept+xml", | |
"type": "application/epub+zip" | |
}, | |
{ | |
"drm": "http://www.feedbooks.com/audiobooks/access-restriction", | |
"type": "application/audiobook+json" | |
}, | |
{ | |
"drm": "Libby DRM", | |
"type": "application/vnd.overdrive.circulation.api+json;profile=audiobook" | |
}, | |
{ | |
"drm": "application/vnd.librarysimplified.findaway.license+json" | |
} | |
] | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment