Azw3 OPDS feed?

563 views
Skip to first unread message

Kevin Palm

unread,
Feb 7, 2021, 9:49:26 AM2/7/21
to Standard Ebooks
All,

I have a request, but I'll state up front that I recognize that it probably won't be worth the hassle.  I'll ask anyway.  ;-)  Would it be even possible to have separate OPDS feeds for the different book formats you offer?  I have a Kindle Oasis, so I really only need to access azw3 files, but the OPDS client I use with calibre will only download the first format of each book, which ends up being epub.  I'm a nerd who has to have the most current version of each book, so I check daily for updates via the OPDS feed, and being able to select only azw3 books from the feed would be GLORIOUS!  ;-)  Again, I realize that it'll probably be a major hassle, but I hoped it wouldn't hurt to ask!

Cheers,
Kevin

Alex Cabal

unread,
Feb 7, 2021, 2:38:29 PM2/7/21
to standar...@googlegroups.com
This is probably better done as a bug fix in your OPDS client. Mirroring
each of the feeds for just Kindle would be a lot of work for us, and an
OPDS client that doesn't recognize multiple download options is, I
think, not compliant.
> --
> You received this message because you are subscribed to the Google
> Groups "Standard Ebooks" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to standardebook...@googlegroups.com
> <mailto:standardebook...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/standardebooks/62c30cc1-d2af-4f67-8c02-151094473412n%40googlegroups.com
> <https://groups.google.com/d/msgid/standardebooks/62c30cc1-d2af-4f67-8c02-151094473412n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Kevin Palm

unread,
Feb 7, 2021, 3:12:44 PM2/7/21
to Standard Ebooks
Thanks for the reply, Alex.  I'm using steinarb's OPDS plugin with calibre, which works great to let me know which books have been updated and when, but won't let me choose which format to download.  I submitted a request to enable the choice back in October, but he hasn't responded to it.  Maybe I could tinker with it, it'll give me a good excuse to learn code!  ;-)

https://github.com/steinarb/opds-reader

David Grigg

unread,
Feb 7, 2021, 4:56:45 PM2/7/21
to standar...@googlegroups.com
If you do manage to modify the code successfully, I would love to know the details, as I would love to do the same trick with kepub files for my Kobo readers.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/901ea86c-2624-4522-a690-19387a4c689an%40googlegroups.com.

John Reid

unread,
Feb 8, 2021, 12:20:26 PM2/8/21
to Standard Ebooks
On lines 171-173 of https://github.com/steinarb/opds-reader/blob/master/calibre_plugin/model.py you'll see that .epub formats are explicitly selected by the plugin. Change these lines:

    if bookType == 'application/epub+zip':
        # EPUB books are preferred and always put at the head of the list if found
        bookDownloadUrls.insert(0, url)


to your preferred SE publication format:

application/epub+zip
application/kepub+zip
application/x-mobipocket-ebook (this one is azw3)

I imagine you'll then need to reinstall the plugin. :) Incidentally, you aren't the only ones frustrated by this 'feature', there's more than one open issue with the same problem specifically mentioning standardebooks: https://github.com/steinarb/opds-reader/issues?q=standardebooks

Kevin Palm

unread,
Feb 8, 2021, 12:37:44 PM2/8/21
to Standard Ebooks
Wow, THANK YOU, John!!  I tried something similar with that line, but I changed it to "application/epub+zip", which obviously didn't work.  This is PERFECT!!

Thank you again!
Kevin
Message has been deleted

Kevin Palm

unread,
Feb 8, 2021, 12:43:53 PM2/8/21
to Standard Ebooks
Damn copy and paste!  I MEANT that I changed it to  "application/azw3+zip"...  :-)

John Reid

unread,
Feb 8, 2021, 1:29:07 PM2/8/21
to standar...@googlegroups.com
Glad to help 😊

You received this message because you are subscribed to a topic in the Google Groups "Standard Ebooks" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/standardebooks/JN9Q1CB67r4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to standardebook...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/21b54901-94e7-48c4-9720-2bff84985517n%40googlegroups.com.

John Reid

unread,
Feb 14, 2021, 5:34:04 AM2/14/21
to Standard Ebooks
This problem has also been solved in this recently released Calibre plugin which adds Standard Ebooks as a 'Get Books' source and allows the selection of downloaded format: https://groups.google.com/g/standardebooks/c/czCsi3Wwd5s/m/LIS0RRjRBwAJ. Kudos to InfiniteAnts for this work.

Kevin Palm

unread,
Feb 14, 2021, 11:04:39 AM2/14/21
to Standard Ebooks
That's a great plugin, for sure, but your solution to the OPDS reader was what solved my particular problem!  I was looking for a way to download the most recently updated books in the azw3 format.  The listing in the OPDS feed lets me see at a glance when each book was updated, then select just those books to download.  From what I can see, the "Get Books" plugin just opens up an instance of the SE main selection page, which lists the books in order of their release date, not their update date.  Unless I'm missing something...

InfiniteAnts

unread,
Feb 14, 2021, 1:02:19 PM2/14/21
to Standard Ebooks
Did you click on Stores -> Standard Ebook. That will open up a browser instance directing you to the SE main selection page. The main functionality of the plugin is by clicking on Get Books, searching for your book and then downloading it straight into your Calibre. Your browser won't open. It should look like this: Screenshot 2021-02-13 at 9.04.36 PM.pngScreenshot 2021-02-13 at 9.04.58 PM.png

InfiniteAnts

unread,
Feb 14, 2021, 1:07:02 PM2/14/21
to Standard Ebooks
After reading through the thread, I see that you want to update your books. That's a pretty good use case, I can see myself doing that too.
I guess I can add the last updated field to one of the columns in the search results window, if the Calibre source code allows me to do that. I'll take a look at it.

Kevin Palm

unread,
Feb 14, 2021, 3:36:01 PM2/14/21
to Standard Ebooks
On Sunday, February 14, 2021 at 1:07:02 PM UTC-5 InfiniteAnts wrote:
After reading through the thread, I see that you want to update your books. That's a pretty good use case, I can see myself doing that too.
I guess I can add the last updated field to one of the columns in the search results window, if the Calibre source code allows me to do that. I'll take a look at it.

That would be great!  Yeah, as often as SE updates their books (and as anal as I am about keeping my collection current), I LOVE the way the OPDS feed lets me know what I need to download.  It makes it SO much easier!

Screenshot from 2021-02-14 15-32-21.png 

InfiniteAnts

unread,
Feb 14, 2021, 4:54:19 PM2/14/21
to Standard Ebooks
Does it update the books already in your library automatically or do you have to select those books and download them again?

David Grigg

unread,
Feb 14, 2021, 5:19:18 PM2/14/21
to standar...@googlegroups.com
You have to select them and download them again. And then Calibre will flag the download as already being in your library, do you still want to add it. If you say YES then you have two copies in your library.

So there’s plenty of room for improvement in that plugin.
--

You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.

Kevin Palm

unread,
Feb 14, 2021, 5:20:47 PM2/14/21
to Standard Ebooks
No, I download the books, then I run a plugin that finds duplicates.  I then delete the old versions.  It's kludgy, but it works when there aren't a lot of updates.

Kevin Palm

unread,
Feb 14, 2021, 5:21:36 PM2/14/21
to Standard Ebooks
Absolutely!  

InfiniteAnts

unread,
Feb 14, 2021, 6:59:48 PM2/14/21
to Standard Ebooks
Hmm I'll take a look at that plugin and see if there is a way to automate all that. Will be pretty useful too considering how often these ebooks are updated.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Asher Smith

unread,
Mar 8, 2022, 12:54:21 PM3/8/22
to Standard Ebooks
I'm now struggling with this. The advanced epubs end with _advanced.epub, rather than .epub; I think this makes them come first alphabetically, and so they're getting downloaded even though my settings say to download .epubs.

Has anybody solved this problem previously?

David

unread,
Mar 9, 2022, 7:03:15 AM3/9/22
to Standard Ebooks
Reading through the thread (and possibly getting the wrong end of the stick, as it were), I wonder if it's possible to modify the plugin's code this way...

It relies on "bookType" to pull the epub:


Could you replace those few lines to filter on "bookTitle" instead? Something like this:

  bookTitle = link.get('title', '')
  # Skip covers and thumbnails
  if not bookTitle.startswith('image/'):
      if bookTitle == 'Recommended compatible epub':

          # EPUB books are preferred and always put at the head of the list if found
          bookDownloadUrls.insert(0, url)

Since the format of the OPDS feed is (e.g.):

<link href="/ebooks/william-shakespeare/twelfth-night/downloads/william-shakespeare_twelfth-night.epub" rel="http://opds-spec.org/acquisition/open-access" title="Recommended compatible epub" type="application/epub+zip"/>
<link href="/ebooks/william-shakespeare/twelfth-night/downloads/william-shakespeare_twelfth-night_advanced.epub" rel="http://opds-spec.org/acquisition/open-access" title="Advanced epub" type="application/epub+zip"/>

I imagine that makes it very much SE specific . . . so perhaps not the most elegant solution. Presumably there's some regex jiggery-pokery with negative lookaheads that could filter out advanced epubs and kepubs and keep the compatible epub link, but I'm not competent to compose such things!

FWIW. YMMV.

David
--
Scotland

Asher Smith

unread,
Mar 18, 2022, 12:43:26 PM3/18/22
to Standard Ebooks
That did it! Many thanks.
Reply all
Reply to author
Forward
0 new messages