[PR #3435] [MERGED] Move to node-unrar-js for cbr and node-stream-zip for cbz #3975

Closed
opened 2026-04-25 00:17:47 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3435
Author: @mikiher
Created: 9/18/2024
Status: Merged
Merged: 9/18/2024
Merged by: @advplyr

Base: masterHead: comic-book-extractors


📝 Commits (3)

  • 0d08aec Move from libarchive to node-unrar-js for cbr and node-stream-zip for cbz
  • 072028c Cleanup empty directiories inside the temp extraction dir
  • 1a8811b Remove unused requires

📊 Changes

4 files changed (+238 additions, -53 deletions)

View changed files

📝 package-lock.json (+9 -0)
📝 package.json (+1 -0)
server/utils/comicBookExtractors.js (+207 -0)
📝 server/utils/parsers/parseComicMetadata.js (+21 -53)

📄 Description

This is a continuation of PR #3422, and more comprehensively fixes #3406, fixes #3399, and fixes #2526.

I looked for a replacement for libarchive for extraction from cbr (rar) files. I found node-unrar-js which seems to work similarly to libarchive (with the extraction algorithm implemented in a wasm module), and which seems to work well on a few files that libarchive failed on, and additionally doesn't require loading the full cbr into a buffer. The npm package is minimal and has 0 dependencies.

Additionally, I moved from libarchive to our existing libs/nodeStreamZip implementation for cbz files.

The old libarchive implementation as well as the new implementations are all wrapped with the same interface, and parseComicMetadata was modified to use that interface.

I'm temporarily keeping the libarchive implementation so that we can move back to it in case we have any serious issues with the new implementations. Will remove it in a couple of weeks.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3435 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 9/18/2024 **Status:** ✅ Merged **Merged:** 9/18/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `comic-book-extractors` --- ### 📝 Commits (3) - [`0d08aec`](https://github.com/advplyr/audiobookshelf/commit/0d08aecd56b13695c490c4797eb462b8f6dc794e) Move from libarchive to node-unrar-js for cbr and node-stream-zip for cbz - [`072028c`](https://github.com/advplyr/audiobookshelf/commit/072028c740dcb66c500580c0134c4f9592d448cc) Cleanup empty directiories inside the temp extraction dir - [`1a8811b`](https://github.com/advplyr/audiobookshelf/commit/1a8811b69afa267904746130da2a83b2f99709c2) Remove unused requires ### 📊 Changes **4 files changed** (+238 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+9 -0) 📝 `package.json` (+1 -0) ➕ `server/utils/comicBookExtractors.js` (+207 -0) 📝 `server/utils/parsers/parseComicMetadata.js` (+21 -53) </details> ### 📄 Description This is a continuation of PR #3422, and more comprehensively fixes #3406, fixes #3399, and fixes #2526. I looked for a replacement for libarchive for extraction from cbr (rar) files. I found node-unrar-js which seems to work similarly to libarchive (with the extraction algorithm implemented in a wasm module), and which seems to work well on a few files that libarchive failed on, and additionally doesn't require loading the full cbr into a buffer. The npm package is minimal and has 0 dependencies. Additionally, I moved from libarchive to our existing libs/nodeStreamZip implementation for cbz files. The old libarchive implementation as well as the new implementations are all wrapped with the same interface, and parseComicMetadata was modified to use that interface. I'm temporarily keeping the libarchive implementation so that we can move back to it in case we have any serious issues with the new implementations. Will remove it in a couple of weeks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:47 +02:00
adam closed this issue 2026-04-25 00:17:47 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3975