LinguaCafe icon indicating copy to clipboard operation
LinguaCafe copied to clipboard

Add support for OPDS import

Open aero31aero opened this issue 11 months ago • 2 comments

Hi, I'd like to propose adding OPDS import. In case you're unfamiliar with OPDS, its an XML based API for browsing library catalogues that makes it very simple to download books. You can read the full spec here but I'll show a dummy session below:

I run a calibre-web instance for my books, which exposes an api like:

$ curl https://calibre.example.com/opds/ # opds home-page
$ curl https://calibre.example.com/opds/language # lists the languages of books available
$ curl https://calibre.example.com/opds/language/3 # this happens to be my target lang and this page shows all my books in my target lang.

Any specific entry looks like this:

<entry>                                                                                                                                                                                                                                   
    <title>나태주동시집</title>                                                                                                                                                                                                             
    <id>urn:uuid:f89fc892-82a8-4bb9-8406-fa19deda93b9</id>                                                                                                                                                                                  
    <updated>2023-08-05T00:17:44+00:00</updated>                                                                                                                                              
      <author>                                                                                                                                                                                                                              
        <name>나태주 창작 동시집 (나태주) (Z-Library)</name>                                                                                                                                                                                
      </author>                                                                                                                                                                                                                    
    <published>2020-11-17T18:30:00+00:00</published>                                                                                                                                                                                                                                                                                                                                                                                    
      <dcterms:language>kor</dcterms:language>                                                                                                                                                                                                                                                                                                                                                                                                
    <link type="image/jpeg" href="/opds/cover/125" rel="http://opds-spec.org/image"/>                                                                                                                                                       
    <link type="image/jpeg" href="/opds/cover/125" rel="http://opds-spec.org/image/thumbnail"/>                                                                                                                                             
                                                                                                                                                                                                                              
    <link rel="http://opds-spec.org/acquisition" href="/opds/download/125/epub/"                                                                                                                                                            
          length="47908934" mtime="2023-08-05T00:17:44+00:00" type="application/epub+zip"/>                                                                                                                                                 
                                                                                                                                                                                                                                            
  </entry>

This would make importing books trivial (instead of downloading them locally and then uploading them), or also allow you to set up auto-import rules such that you set a language and all books in your catalog in that language get imported.

aero31aero avatar Mar 21 '24 06:03 aero31aero