Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <!-- These are comments; you can remove them or leave them, as you wish. They will be ignored. -->
- <!-- We will use this book as an example: https://www.audible.com/pd/A-Study-in-Scarlet-Audiobook/B0D4R9F4ND -->
- <!--
- The OPF file *MUST* have at least one identifier, and can have multiple identifiers.
- They will be defined below in <dc:identifier id="some-arbitrary-id-goes-here">....</dc:identifier> elements.
- One of these must uniquely identify the book, and its ID must be listed in the unique-identifier attribute of the package element.
- The ID of this unique identifier is ASIN in this example, taken from Audible's books.
- -->
- <!-- The dc: namespace elements come from Dublin Core metadata set, see https://www.dublincore.org/specifications/dublin-core/dces/ for details. -->
- <package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="ASIN">
- <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata">
- <!-- The title will be displayed normally by Audiobookshelf; the file-as value will be used for sorting and is optional if you don't want to bother. -->
- <dc:title opf:file-as="Study in Scarlet, A">A Study in Scarlet</dc:title>
- <!-- The subtitle is purely optional. It will be displayed on the book details page in a smaller font. -->
- <dc:subtitle>Subtitle goes here</dc:subtitle>
- <!--
- Audiobookshelf uses calibre namespace elements to define the series, using calibre's syntax for the numbering.
- You can have as many pairs of series and series_index elements as you like, to have a particular book be a member of multiple series. In this case, ABS will display the series membership on the book details page under the title in the order you define them here.
- If you omit the series_index element, the book *will* pe shows as part of the series, it just won't have a number and its sorting is undefined (currently, ABS displays these last, after the highest numbered entry.)
- You must not omit the series element, only the series_index one is optional (it wouldn't even make sense to have a number without a series.)
- If you have series names without a number, I recommend you move those to be the last series entries; if nothing else, it'll reduce the likelihood of you making a mistake.
- -->
- <meta name="calibre:series" content="Sherlock Holmes"/>
- <meta name="calibre:series_index" content="1"/>
- <meta name="calibre:series" content="Example Other Series"/>
- <meta name="calibre:series_index" content="5"/>
- <meta name="calibre:series" content="And a Third Series with No Number Just Because"/>
- <!-- The narration language -->
- <dc:language>English</dc:language>
- <!-- An identifier (happens to be the unique one.) The scheme is technically arbitrary, but the ASIN scheme name is well-known and understood, use this name for ASINs. -->
- <dc:identifier id="ASIN" opf:scheme="ASIN">B0D4R9F4ND</dc:identifier>
- <!-- Another identifier, optional, for my own use, with a made-up "GOODREADS" scheme name. ABS doesn't use it in any way, I just like to have a back reference to the book being narrated, just in case. Here it's the Goodreads numeric ID of the particular edition of the book I believe was used for narrating. -->
- <dc:identifier id="GOODREADS" opf:scheme="GOODREADS">102868</dc:identifier>
- <!--
- Audiobookshelf uses dc:creator elements to parse author(s) and narrator(s).
- dc:creator (and dc:contributor, for that matter) elements must list a MARC relator code to identify the role. See https://www.loc.gov/marc/relators/relaterm.html for a full list. The only ones you'll probably encounter and use are:
- * The author(s), with opf:role="aut"
- * The narrator(s), with opf:role="nrt"
- ABS will not use info from dc:contributor tags, but for example for short story collections I use a dc:creator entry with role "aut" for the editors (instead of using the "edt" role), and then I list the individual story authors as dc:contributor tags with role "ctb". Audiobookshelf will ignore those for now, but who knows what the future brings, and I like to not lose info.
- -->
- <!--
- The author. ABS won't use the file-as to the best of my knowledge, but let's be tidy, shall we.
- For books with multiple authors, just list them all in individual dc:creator role="aut" elements in your preferred order. ABS will display them in that order on the book details page.
- -->
- <dc:creator opf:role="aut" opf:file-as="Doyle, Arthur Conan">Arthur Conan Doyle</dc:creator>
- <!--
- The narrator. Similar to the above.
- -->
- <dc:creator opf:role="nrt" opf:file-as="Keeble, Jonathan">Jonathan Keeble</dc:creator>
- <!-- The publisher name. -->
- <dc:publisher>SNR Audio</dc:publisher>
- <!--
- ABS will use dc:subject elements to define the genre, (the stuff under /config/item-metadata-utils/genres; it'll be populated when scanning, you don't need to predefine them in ABS.)
- You can for example use Goodreads shelf names as subjects.
- These are optional, and you can have any number of them.
- -->
- <dc:subject>Fiction</dc:subject>
- <dc:subject>Detective Fiction</dc:subject>
- <dc:subject>Crime Fiction</dc:subject>
- <dc:subject>Mystery</dc:subject>
- <dc:subject>Thriller</dc:subject>
- <dc:subject>Literary Classics</dc:subject>
- <!--
- The book description.
- It's extremely, extremely advisable to use a CDATA node for the description, especially if you copy-paste it from somewhere else, who knows what stuff'll be in there that could break XML syntax. See https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean for what the CDATA stuff means, but in short just leave the "<![CDATA[" and "]]>" parts untouched, and then you can paste anything in between them without fear of breaking stuff. The only thing that can't appear in the description is a literal "]]>" sequence, but how likely is that to legitimately show up :)
- -->
- <dc:description><![CDATA[
- Our first meeting with Sherlock Holmes. And John Watson's too! The young doctor is astonished by Holmes' many idiosyncrasies, including his talents on the violin.
- But it's not long before Sherlock Holmes, with Watson in tow, is working with Scotland Yard investigating the murder of two Americans whose deaths have some mysterious connection to sinister groups gathering power in both Britain and America.
- ]]></dc:description>
- <!--
- The book tags. Same syntax and rules as for the dc:subject elements above. This ends up being the stuff under /config/item-metadata-utils/tags.
- -->
- <dc:tag>some tag name</dc:tag>
- <dc:tag>another tag</dc:tag>
- <dc:tag>As Many As You Like :)</dc:tag>
- <!-- The publication date of the audiobook, in RFC 3339 syntax, see https://www.ietf.org/rfc/rfc3339.txt for details. Audible will use an URC timestamp, the one with a trailing Z. You can also use just the year, or year-month, or year-month-date and so on. -->
- <dc:date opf:event="publication">2024-06-06T00:00:00.000Z</dc:date>
- <!-- This is my own invented extension; ABS will ignore any <meta> elements it doesn't recognize. I use a meta element with the pub:originalyear name to hold the publication year of the original book (I'm using this in some local scripts). Left it here as an example of how to annotate the OPF in a way that's futureproof and won't break ABS. -->
- <meta name="pub:originalyear" content="1887"/>
- </metadata>
- <manifest/>
- <spine/>
- </package>
Advertisement
Add Comment
Please, Sign In to add comment