A small and modular media manager

Overview

Bookshelf - a small and modular media manager

Bookshelf is made for managing media, mainly books. Modules are to be made by the user (or stolen from the internet) and used to scrape data from websites, thereby getting metadata and download entire books and other items.

This is something I'm making to learn Rust. It's totally not because I wanted a way to scrape books like manga from online and read them later. It's made mainly for managing books but can be used to manage any media.

Usage

Adding and Downloading a new item

# Add to index (but don't download) item using module `example_mod` with code `12345`
bookshelf add -m example_mod -c 12345

# Add to index and download item from URL
bookshelf download -u https://example.com/book/12345

Search in index

# Search for items whose titles begin with "The", are made by "John Doe" have
# the "sci-fi" and "comedy" but not "horror" genre
bookshelf search -t "^The.*" -a "John Doe" -g "sci-fi,comedy" -b "horror"

# Search in favorites fir books by either "Jane Smith" or "Bob Ross" and of genre "romance" or "comedy"
bookshelf search -f -a "Jane Smith,Bob Ross" -g "romance,comedy" --broad_search

Getting item information

# Get item handled by module `example_mod` with code `12345`
bookshelf info -m example_mod -c  12345

Update items

# Toggle favorite for book handled by `example_mod` with id `1234`
bookshelf update -m example_mod -c 12345 -f

# Update book with new title, author and genre
bookshelf update -m example_mod -c 12345 -t "New title" -a "Alice" -g "comedy,horror"

Download saved item

# Download everything saved in index
bookshelf pull

# Download items handled by `example_mod` and created by "Bob"
bookshelf pull -m example_mod -a "Bob"

Remove items

# Remove item from index and favorites, as well as its downloaded files
bookshelf rm -m example_mod -c 12345

List available modules

bookshelf modules

Import/Exporting shelf

# Export current index to yaml file
bookshelf export -f index.yaml

# Import yaml index file to current index
bookshelf import -f index.yaml

TUI mode

To launch bookshelf in TUI mode, simply run bookshelf without arguments.

TUI

  • Down/j : move down
  • Up/k : move up
  • ctrl-D : move down 50%
  • ctrl-U : move up 50%
  • Home: go to top
  • End: go to bottom
  • F : toggle favorite (add/remove item to/from favorites)
  • y : yank (copy) item (module and code) to clipboard
  • o : open item
  • w : write to index file
  • ft/fa/fg : filter by title regex/authors/genres
  • et/ea/eg : edit title/authors/genres
  • Esc : cancel filter/edit

Configuration

Currently, the following settings (and their default values) can be set in bookshelf .yaml:

  "index_file": "~/.config/bookshelf/index"
  "modules_dir": "~/.config/bookshelf/modules"
  "data_dir": "~/.config/bookshelf/data"

Books and other items are stored in data_dir in their own directories.

Making a new module

A module can be written in any language. It only needs to be made executable and placed in the modules directory to be used. The metadata and download are mostly handled by the module with little to no help from bookshelf because every site has its own ways to get metadata and download items, and it's a lot simpler to have the individual modules handle everything for that.

A module should be able to handle the following commands:

your_mod check $URL

Given a URL, the module prints a 1 (with or without newlines) if the URL can be processed by the module, and 0 otherwise

your_mod code $URL

Given a URL, the module prints the code identifying the item.

your_mod url $CODE

Given a code, the module prints the URL for the item.

your_mod metadata $CODE

Print title, authors, and genres for the item with the provided code. The 3 items are on separate lines, with authors and genres being comma-separated. For example:

Rust for noobs
John Doe,Jane Smith
education,programming

your_mod download $CODE

The module downloads the book with the provided code. No out put is expected, and everything is done by the module in this case. Any and all output is ignored by bookshelf, so feel free to print anything.

your_mod media

Print the media type of the item handled by the module, for example: jpg, png, pdf, txt, mp3, mp4. This is for the (to be implemented) feature of opening the downloaded files with other programs.

Misc

License: GNU GPLv3

You might also like...
A cryptographically verifiable code review system for the cargo (Rust) package manager.
A cryptographically verifiable code review system for the cargo (Rust) package manager.

A cryptographically verifiable code review system for the cargo (Rust) package manager.

A simple password manager written in rust

Passman - A password manager written in rust. How to use?: USAGE: passman option Currently available options are: new - initalize passman with a new m

A simple password manager written in Rust
A simple password manager written in Rust

ripasso A simple password manager written in Rust. The root crate ripasso is a library for accessing and decrypting passwords stored in pass format (G

Manager for single node Rancher clusters

Bovine Manage single node Rancher clusters with a single binary, bovine. % bovine run Pulling [rancher/rancher:latest], this may take awhile... Ranche

A password manager coded in rust

pasman A password manager coded in rust Install Dependency rust Shell git clone https://github.com/AMTitan/pasman.git cd pasman cargo build --release

The free password manager for power users
The free password manager for power users

The free password manager for power users

Cloup is a template manager that provides the files you desire when you need them, written in Rust.
Cloup is a template manager that provides the files you desire when you need them, written in Rust.

cloup cloup is a template manager that delivers the files you desire when you need them, written in rust you no longer need to locate your previous pr

experimental package manager for node.js

pacquet Experimental package manager for node.js written in rust. Disclaimer: This is mostly a playground for me to learn Rust and understand how pack

A Password Manager Using age for Encryption

A Password Manager Using age for Encryption Contents Features Usage Install Import from pass How It Works Features It is inspired by pass. senior's fe

Comments
  • Bump regex from 1.4.5 to 1.5.5

    Bump regex from 1.4.5 to 1.5.5

    Bumps regex from 1.4.5 to 1.5.5.

    Changelog

    Sourced from regex's changelog.

    1.5.5 (2022-03-08)

    This releases fixes a security bug in the regex compiler. This bug permits a vector for a denial-of-service attack in cases where the regex being compiled is untrusted. There are no known problems where the regex is itself trusted, including in cases of untrusted haystacks.

    1.5.4 (2021-05-06)

    This release fixes another compilation failure when building regex. This time, the fix is for when the pattern feature is enabled, which only works on nightly Rust. CI has been updated to test this case.

    1.5.3 (2021-05-01)

    This releases fixes a bug when building regex with only the unicode-perl feature. It turns out that while CI was building this configuration, it wasn't actually failing the overall build on a failed compilation.

    1.5.2 (2021-05-01)

    This release fixes a performance bug when Unicode word boundaries are used. Namely, for certain regexes on certain inputs, it's possible for the lazy DFA to stop searching (causing a fallback to a slower engine) when it doesn't actually need to.

    [PR #768](rust-lang/regex#768) fixes the bug, which was originally reported in ripgrep#1860.

    1.5.1 (2021-04-30)

    This is a patch release that fixes a compilation error when the perf-literal feature is not enabled.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
Chocolate Overflow
Chocolate Overflow
Tiny media transcoding utility for node 🎶

Mediaplex Tiny media transcoding utility for node. ??️ This package is a work in progress. Installation $ npm install --save mediaplex Example const m

AndrozDev 5 Jul 22, 2023
Highly modular & configurable hash & crypto library

Octavo Highly modular & configurable hash & crypto library written in pure Rust. Installation [dependencies] octavo = { git = "https://github.com/libO

Octavo Developers 139 Dec 29, 2022
An implementation of the paper "Honey Badger of BFT Protocols" in Rust. This is a modular library of consensus.

Honey Badger Byzantine Fault Tolerant (BFT) consensus algorithm Welcome to a Rust library of the Honey Badger Byzantine Fault Tolerant (BFT) consensus

null 335 Dec 25, 2022
Kraken is a Starknet modular decentralized sequencer implementation.

Lambda Starknet Sequencer A Starknet decentralized sequencer implementation. Getting started The objective of this project is to create an L2 decentra

Lambdaclass 10 Jun 25, 2023
dWallet Network, a composable modular signature network is the home of dWallets

Welcome to dWallet Network dWallet Network, a composable modular signature network is the home of dWallets. A dWallet is a noncollusive and massively

dWallet Labs 8 Feb 26, 2024
CLI password manager with encryption: AES256, Salsa20 and Chacha20, with cross platform and exclusive features

Keep My House (CLI) CLI password manager with encryption: AES256, Salsa20 and Chacha20, with cross platform and exclusive features Features AES256 GCM

null 4 Sep 7, 2023
A lightning-fast password generator and manager written in Rust

Passlane A lightning-fast password manager for the command line Features Generate passwords Place the generated password into the clipboard Save previ

Anssi Piirainen 4 Dec 15, 2022
A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap

rucksack A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap Features Password gene

null 6 Jan 18, 2023
The simple password manager for geeks, built with Rust.

Rooster Rooster is a simple password manager for geeks (it works in the terminal). Rooster is made available free of charge. You can support its devel

Conrad Kleinespel 131 Dec 25, 2022
🐴 RusTOTPony — CLI manager of one-time password generators aka Google Authenticator

?? RusTOTPony CLI manager of time-based one-time password generators. It is a desktop alternative for Google Authenticator. Installation Arch Linux Pa

German Lashevich 23 Jan 5, 2023