A local database that stores the information of books and pages.
- id: The book's id (int), as indicated by the book's url (
https://www.pubu.com.tw/ebook/[book_id]
). - documentId: The book's document id (int).
- title: The book's title (text).
- pages: Number of pages (int).
- author: The book's author (text).
- cover: The url of the book's cover image (text).
- price: The book's price (int).
- publisher: The book's publisher (text).
- type: The book's category (text).
- error: Error code when fetching the book.
Store the pages of a book. The pages are stored in a compact format, which removes most metadata of the pages.
- documentId: The book's document id (int).
- pagesBlob: The encoded and compressed urls of the pages of a book (blob).
A fixed table that records the file extension of pages.
id | ext |
---|---|
1 | .jpg |
A fixed table that records the front of a page's url.
front | enum |
---|---|
"duyldfll42se2" | 0 |
"d3lcxj447n2nux" | 1 |
"d24p424bn3x9og" | 2 |
"d3rhh0yz0hi1gj" | 3 |
Records the latest page id recorded in pages
.
id | data |
---|---|
0 | page id |
These are files that are outside the database. They store the record of each page and can be deleted after these records are saved in the database.
Theese records store the metadata of each page, including error pages. Each file [i].bin
stores 1M pages, compressed by zlib. Each page is encoded as 16 bytes data, with the following structure:
- Byte 0 ~ 4: Page id
- Byte 4 ~ 8: Document id
- Byte 8 ~ 9: file extension (4 bits) || front of the domain name (4 bits)
- Byte 9 ~ 16: filename (or HTTP error code) padded with null bytes