openzim / nautilus

Turns a collection of documents into a browsable ZIM file
GNU General Public License v3.0
19 stars 14 forks source link

Add URLs support to collection #59

Closed rgaudin closed 12 months ago

rgaudin commented 1 year ago

To support nautilus-webui but also because it makes nautilus a lot more flexible, we want the JSON collection to support setting URLs on each entry in addition to files.

Because the simple List[str] for files is already showing limits (#57), we want to extend it.

{
  "archive-member": "01 BOOK for printing .pdf",  # optional, member name inside archive (same as current)
  "url": "http://books.com/310398120.pdf",  # optional, has precedence over `archive-member`, url to download file from
  "filename": "My book.pdf",  # optional, filename to use in ZIM, regardless of original one
}

One of archive-member or url should be present, otherwise it is not considered. All those url are to be fetched and stored in the ZIM, at the requested filename or using the basename of the URL.

User is responsible for not uniqueness of filenames.