rplay

command module
v0.4.1-0...-b842453 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2021 License: BSD-2-Clause Imports: 31 Imported by: 0

README

RPlay

CI Status Go ReportCard

A command line MP3 player for your Restic repository.

Features

  • Index and play available audio files (flac, mp3, ogg)
  • ID3 metadata support
  • Search your music collection (filename or ID3 tag)
  • Support for indexing multiple Restic repositories
  • Random, endless playback
  • Optionally fetch missing song metadata (artist, album, etc) from Internet (see ACOUSTICID.md)
  • macOS and Linux supported

Installation

Binaries for Linux are available in the releases page.

You'll need to build from source for macOS and other Linux architectures:

GO111MODULE=on go get -u github.com/rubiojr/rplay

Or clone the repository and run go build.

Usage

⚠️ A word of caution

RPlay does not encrypt the index created (locally, where rplay runs), meaning that the following information from your Restic repository will be available to those with access to the index:

  • Audio file names and ID3 metadata
  • Audio file contents (cached locally for playback and other things)
  • Repository ID
  • Restic (packed)blob metadata (the SHA256 of the Packfile where the blob is stored, blob length, offset within the pack file)
  • Last file modification time (mtime)
  • Hostname where the file was backed up
  • Full file path when it was backed up
Indexing your MP3

The first thing we need to do, is to index the repository:

Indexing yields some stats while indexing:

⢿ Taco Tuesday.mp3          🎯 62 new, 0 skipped, 0 errors, 11 f/s, 0.02 minutes left

file being indexed, indexed files count, already indexed, indexing speed, remaining time

and when the indexing process finishes:

💥 74 indexed, 0 already present. Took 5 seconds.

Worth noting also that RPlay accepts the same repository (the -r flag) URIs and backends Restic does, which means S3, rest-server, Backblaze, etc are all supported.

The indexing process will create an index in a OS specific path:

Linux

~/.local/share/rplay

MacOS

~/Library/Application Support/rplay

Searching our collection

The search command will search our indexed files (filename searching only for now):

Playing our tunes

Once we have indexed our repository, we're ready to play:

The play command also supports playing a specific file:

$ rplay -r rest:http://localhost:8000 search "*playa*"
Searching for *playa*...
ID:                  e6a9a3e7e630744cd6bcfd0820a25f7b9b467c5d472f7d0f1bd443103f1fa35c
Album:               La Playa
Artist:              DJ ALEX
Filename:            La Playa.mp3
Genre:               unknown
Title:               La Playa
Year:                20190718
rplay -r rest:http://localhost:8000 play e6a9a3e7e630744cd6bcfd0820a25f7b9b467c5d472f7d0f1bd443103f1fa35c
Playing e6a9a3e7e630744cd6bcfd0820a25f7b9b467c5d472f7d0f1bd443103f1fa35c...

⣾ Next song found, loading...
album:               La Playa
artist:              DJ ALEX
filename:            La Playa.mp3
genre:
title:               La Playa
year:                20190718
Environment variables

RPlay supports configuring Restic's repository location and credentials via environment variables, so you don't have to type the URI and password all the time:

export RESTIC_REPOSITORY=rest:http://localhost:8000
export RESTIC_PASSWORD=secret

Roadmap

  • Better curses UI
  • Flag songs as hidden/unwanted

Credits

RPlay is an experiment quickly built in a few days thanks to the following projects that power it:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
fps

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL