Skip to main content

REPL to stream music from a Subsonic server to a chromecast

Project description

CastMe

CastMe is a simple Python REPL that allows you to cast music from a Subsonic server to a Chromecast device, or to the local device.

NOTE: The subsonic server must expose a URL over HTTPS. And since the chromecast will be the one connecting to the server, the certificate need to be trusted. This project is tested against Navidrome only.

Installation (pip / pipx / ...)

castme is available directly in pypi:

pip install castme

Just create the configuration file using --init and edit the content:

> castme --init
Configuration initialized in /home/blizarre/.config/castme.toml, please edit it before starting castme again

Castme will automatically look for the castme.toml file in /etc or in the current directory as well. use --config in conjunction with --init to set the location of the configuration file.

Usage

Run the script, and enter the commands in the REPL. For instance:

  • List the available Albums
$ castme
Currently playing on chromecast
[chromecast] >> list
Saint-Saëns: Le carnaval des animaux                Le onde
Brandenburg Concertos 5 and 6 - Violin Concerto     Harold en Italie
  • Play an album based on fuzzy search
[chromecast] >> queue Harld enI
Queueing Harold en Italie
  • Display the queue
[chromecast] >> queue
 1 Harold in the mountains (Adagio - Allegro) / Harold en Italie by Hector Berlioz
 2 The Pilgrim's Procession (Allegretto) / Harold en Italie by Hector Berlioz
 3 Serenade of an Abruzzian highlander (Allegro assai) / Harold en Italie by Hector Berlioz
 4 The Robbers' orgies (Allegro frenetico) / Harold en Italie by Hector Berlioz
  • Set the volume to 50%, then increase by 20%
[chromecast] >> volume 50
[chromecast] >> volume +20
  • Pause and resume
[chromecast] >> playpause
[chromecast] >> playpause
  • List the backends and switch to the local backend to play the music on the computer
[chromecast] >> switch
Available targets: chromecast, local
[chromecast] >> switch local
  • Skip the current song and display the new queue
[local] >> next
[local] >> q
 1 The Pilgrim's Procession (Allegretto) / Harold en Italie by Hector Berlioz
 2 Serenade of an Abruzzian highlander (Allegro assai) / Harold en Italie by Hector Berlioz
 3 The Robbers' orgies (Allegro frenetico) / Harold en Italie by Hector Berlioz
  • Exit the app
>> quit

commands: help, list (l), next (n), rewind (r), play (p), playpause (pp), queue (q), quit (x), volume (v), clear (c).

Aliases are defined for the most common commands (in parenthesis).

Installation (dev)

  • Clone the repository
  • Install the required dependencies using Poetry or the install makefile target:
make install
  • Copy the config file template "castme/assets/castme.toml.template" to one of the supported directory and update the values inside
    • "castme.toml"
    • "~/.config/castme.toml"
    • "/etc/castme.toml"

During development, make dev will run the formatters and linters for the project.

There is a debug mode that print additional information at runtime. Use the --debug flag.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

castme-0.3.1.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

castme-0.3.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file castme-0.3.1.tar.gz.

File metadata

  • Download URL: castme-0.3.1.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for castme-0.3.1.tar.gz
Algorithm Hash digest
SHA256 29f62a2a02e883b7c66e98dfb273a277014ba966c6ad104cf5b125f751a6ceee
MD5 d946f15db1bf665f5a4b16e552fc5832
BLAKE2b-256 deb53f1df131a01f86b900cf58a7e84adbb957a2ed3d5a79ec8f81923a494546

See more details on using hashes here.

File details

Details for the file castme-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: castme-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for castme-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0e530787351958c38dd5daa30b0b2dd1516c8d2f63e72750b3abf2379d4f55a
MD5 39831da6b30e1e2f95bc63d70853aeb1
BLAKE2b-256 aadf655f871198a40706d0791dde8a4c6cc3d176e67d105911dfbb8144249439

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page