Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Size #36

Open
fakerybakery opened this issue Dec 10, 2023 · 2 comments
Open

File Size #36

fakerybakery opened this issue Dec 10, 2023 · 2 comments

Comments

@fakerybakery
Copy link

Hi,
Sorry to ask so many questions. I was wondering if it might be possible to get the file size of each file. It can be helpful to estimate how long a book is :).

@garethbjohnson
Copy link
Owner

Hi again, no worries, that is another good idea. I found a number value in the Gutenberg catalogue XML files that seems to roughly match the number of bytes in each book format's file.

To alter what I suggested in the last issue thread (#35), I could instead make "all_formats" an array of objects with properties for media type, file URL, and file size:

{
  ...
  "formats": {
    ...
    "application/x-mobipocket-ebook": "https://www.gutenberg.org/ebooks/84.kf8.images",
    ...
  },
  "all_formats": [
    ...
    {
      "media_type": "application/x-mobipocket-ebook",
      "size": 448727,
      "url": "https://www.gutenberg.org/ebooks/84.kindle.images"
    },
    {
      "media_type": "application/x-mobipocket-ebook",
      "size": 476477,
      "url": "https://www.gutenberg.org/ebooks/84.kf8.images"
    },
    ...
  ],
  ...
}

Would that work for you?

@fakerybakery
Copy link
Author

Thank you, that works! Commented in the other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants