{"id":20030868,"url":"https://github.com/devgianlu/go-librespot","last_synced_at":"2025-04-05T00:04:11.166Z","repository":{"id":192755826,"uuid":"687341239","full_name":"devgianlu/go-librespot","owner":"devgianlu","description":"Yet another open source Spotify client, written in Go.","archived":false,"fork":false,"pushed_at":"2025-03-21T12:33:18.000Z","size":933,"stargazers_count":178,"open_issues_count":26,"forks_count":24,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T23:02:39.992Z","etag":null,"topics":["audio-player","spotify","spotify-connect"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devgianlu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-05T06:54:05.000Z","updated_at":"2025-03-28T14:01:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d95fc4e4-e0a6-4dfa-b325-d56b102fdbac","html_url":"https://github.com/devgianlu/go-librespot","commit_stats":null,"previous_names":["devgianlu/go-librespot"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgianlu%2Fgo-librespot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgianlu%2Fgo-librespot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgianlu%2Fgo-librespot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgianlu%2Fgo-librespot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgianlu","download_url":"https://codeload.github.com/devgianlu/go-librespot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266563,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-player","spotify","spotify-connect"],"created_at":"2024-11-13T09:28:55.607Z","updated_at":"2025-04-05T00:04:11.122Z","avatar_url":"https://github.com/devgianlu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-librespot\n\n[![GitHub release](https://img.shields.io/github/release/devgianlu/go-librespot.svg)](https://github.com/devgianlu/go-librespot/releases/latest)\n![GitHub branch check runs](https://img.shields.io/github/check-runs/devgianlu/go-librespot/master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/devgianlu/go-librespot)](https://goreportcard.com/report/github.com/devgianlu/go-librespot)\n[![GitHub License](https://img.shields.io/github/license/devgianlu/go-librespot)](https://github.com/devgianlu/go-librespot/blob/master/LICENSE)\n\nYet another open-source Spotify Connect compatible client, written in Go.\n\n\u003e go-librespot gives you the freedom to have a Spotify Connect device wherever you want.\n\n## Getting Started\n\n### Using prebuilt binary\n\nTo get started you can download prebuilt binaries for\nthe [latest release](https://github.com/devgianlu/go-librespot/releases/latest).\n\nDevelopment prebuilt binaries are also available\nas [GitHub Actions artifacts](https://github.com/devgianlu/go-librespot/blob/249b8fee709e2d08fe9c39a16ad0fc4b737cb967/.github/workflows/release.yml#L62).\n\n### Using Docker\n\nA lightweight Docker image for go-librespot is available\non the [GitHub Container Registry](https://github.com/devgianlu/go-librespot/pkgs/container/go-librespot).\n\nAn example Docker Compose configuration for PulseAudio is available [here](/docker-compose.pulse.yml).\n\n### Building from source\n\nTo build from source the following prerequisites are necessary:\n\n- Go 1.22 or higher\n- Libraries: `libogg`, `libvorbis`, `libasound2`\n\nTo install Go, download it from the [Go website](https://go.dev/dl/).\n\nTo install the required libraries on Debian-based systems (Debian, Ubuntu, Raspbian), use:\n\n```shell\nsudo apt-get install libogg-dev libvorbis-dev libasound2-dev\n```\n\nOnce prerequisites are installed you can clone the repository and run the daemon with:\n\n```shell\ngo run ./cmd/daemon\n```\n\nDetails about cross-compiling go-librespot are described [here](/CROSS_COMPILE.md) (thank you @felixstorm).\n\n## Configuration\n\nThe default directory for configuration files is `~/.config/go-librespot`. You can change this directory with the\n`-config_dir` flag. The configuration directory contains:\n\n- `config.yml`: The main configuration (does not exist by default)\n- `state.json`: The player state and credentials\n- `lockfile`: A lockfile to prevent running multiple instances on the same configuration\n\nThe full configuration schema is available [here](/config_schema.json), only the main options are detailed below.\n\n### Zeroconf mode\n\nThis is the default mode. It uses mDNS auto discovery to allow Spotify clients inside the same network to connect to\ngo-librespot. This is also known as Spotify Connect.\n\nAn example configuration (not required) looks like this:\n\n```yaml\nzeroconf_enabled: false # Whether to keep the device discoverable at all times, even if authenticated via other means\nzeroconf_port: 0 # The port to use for Zeroconf, 0 for random\ncredentials:\n  type: zeroconf\n  zeroconf:\n    persist_credentials: false # Whether to persist zeroconf user credentials even after disconnecting\n```\n\nIf `persist_credentials` is `true`, after connecting to the device for the first time credentials will be stored locally\nand you can switch to interactive mode without having to authenticate manually.\n\nIf `zeroconf_interfaces_to_advertise` is provided, you can limit interfaces that will be advertised. For example, if you have Docker installed on your host, you may want to disable advertising to its bridge interface, or you may want to disable interfaces that will not be reachable.\n\n### Interactive mode\n\nThis mode allows you to associate your account with the device and make it discoverable even outside the network. It\nrequires some manual steps to complete the authentication:\n\n1. Configure interactive mode\n\n    ```yaml\n    zeroconf_enabled: false # Whether to keep the device discoverable at all times\n    credentials:\n      type: interactive\n    ```\n\n2. Start the daemon to begin the authentication flow\n3. Open the authorization link in your browser and wait to be redirected\n4. If go-librespot is running on the same device as your browser, authentication should complete successfully\n5. (optional) If go-librespot is running on another device, you'll need to copy the URL from your browser and call it\n   from the device, for example:\n\n   ```bash\n   curl http://127.0.0.1:36842/login?code=xxxxxxxx\n   ```\n\n### API server\n\nOptionally, an API server can be started to control and monitor the player. To enable this feature, add the following to\nyour configuration:\n\n```yaml\nserver:\n  enabled: true\n  address: localhost # Which address to bind to\n  port: 3678 # The server port\n  allow_origin: '' # Value for the Access-Control-Allow-Origin header\n  cert_file: '' # Path to certificate file for TLS\n  key_file: '' # Path to key file for TLS\n```\n\nFor detailed API documentation see [here](/API.md).\n\n### Volume synchronization\n\nVarious configurations for volume control are available:\n\n1. **No external volume without mixer**: Spotify volume is controlled independently of the device volume, output samples\n   are multiplied with the volume\n2. **No external volume with mixer**: Spotify volume is synchronized with the device volume and vice versa, output\n   samples\n   are not volume dependant, Spotify volume changes are applied to the ALSA mixer and vice versa\n3. **External volume without mixer**: Spotify volume is not synchronized with the device volume, output samples are not\n   volume dependant\n4. **External volume with mixer**: Device volume is synchronized with Spotify volume, output samples are not volume\n   dependant, volume changes are not applied to the ALSA mixer\n\n### Additional configuration\n\nThe following options are also available:\n\n```yaml\nlog_level: info # Log level configuration (trace, debug, info, warn, error)\ndevice_id: '' # Spotify device ID (auto-generated)\ndevice_name: '' # Spotify device name\ndevice_type: computer # Spotify device type (icon)\naudio_backend: alsa # Audio backend to use (alsa, pipe, pulseaudio)\naudio_device: default # ALSA audio device to use for playback\nmixer_device: '' # ALSA mixer device for volume synchronization \nmixer_control_name: Master # ALSA mixer control name for volume synchronization\naudio_buffer_time: 500000 # Audio buffer time in microseconds, ALSA only\naudio_period_count: 4 # Number of periods to request, ALSA only\naudio_output_pipe: '' # Path to a named pipe for audio output\naudio_output_pipe_format: s16le # Audio output pipe format (s16le, s32le, f32le)\nbitrate: 160 # Playback bitrate (96, 160, 320)\nvolume_steps: 100 # Volume steps count\ninitial_volume: 100 # Initial volume in steps (not applied to the mixer device)\nexternal_volume: false # Whether volume is controlled externally \ndisable_autoplay: false # Whether autoplay of more songs should be disabled\n```\n\nMake sure to check [here](/config_schema.json) for the full list of options.\n\n## Development\n\nProtobuf definitions are managed through [Buf](https://buf.build). To recompile, execute:\n\n```shell\nbuf generate\n```\n\nor using Go:\n\n```shell\ngo generate ./...\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgianlu%2Fgo-librespot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgianlu%2Fgo-librespot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgianlu%2Fgo-librespot/lists"}