GithubHelp home page GithubHelp logo

rubiojr / rplay Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 541 KB

Command line audio player for your Restic repository.

License: BSD 2-Clause "Simplified" License

Go 91.89% Makefile 0.59% Shell 7.52%

rplay's Introduction

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:

rplay's People

Contributors

rubiojr avatar

Stargazers

 avatar SDO avatar Jack avatar Mark Smith avatar Tanguy ⧓ Herrmann avatar J. Zebedee avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

dolanor-galaxy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.