Skip to content
项目

关于

Your own music app: listen to your library, search for any song and download what you do not have yet, on a server you control.

设计与媒体

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Eco logo

Eco

Your own music app.
Listen to your library, search for any song and download what you do not have yet, on a server you control.

Latest release CI MIT license

Go React TypeScript Vite Node 22 to build
Docker Compose v2 Navidrome MusicBrainz yt-dlp ffmpeg

Quick start · Adding music · Configuration · Architecture · Contributing

Status: early and actively developed. The interface is English only for now.

What it does

Listen

  • A fast web app you can install on your phone, with a queue, lock-screen controls, a sleep timer and playlists.
  • The whole app takes the colour of the music, and on a computer a deck beside the page holds the song and what plays next. Drag its edge to make it wider, or open the player over the whole tab, as on the TV.
  • Make it yours: a photo of your own or the album playing behind everything (text stays readable on any picture), four player styles (cover, vinyl, backdrop, minimal), glass, card size, fonts and colours. Your look follows you to all your devices.
  • Play on any of your devices from any other: pause, skip, change the volume or move the music across. Only your own devices.
  • On a Roku TV: browse with the remote, or send music to the TV from your phone. The player fills the screen with the album, in your colours. You install it yourself, with no store involved (docs/tv.md).
  • On your computer: the desktop app for Linux, macOS and Windows is the same app in its own window. Closing it keeps the music playing, the media keys work, it plays your downloads with no connection and it updates itself (docs/desktop.md).
  • Make playlists from the songs you have, and add to them from any song's menu.
  • Podcasts and audiobooks have sections of their own: make a show or a book, add episodes or parts from a YouTube link or a file on your device, and carry on where you stopped on any device, with chapters, 30-second skips, bookmarks and notes.

Find and download

  • One search box finds songs in your library and songs and albums you do not own, from MusicBrainz with iTunes as a backup. No account, key or subscription.
  • Open an album to see every track in order and which ones you have, then tick the ones to download. Songs you do not have yet are chosen the same way in search results and on an artist's page.
  • An artist's page starts with their most played songs on your server, then their songs, the ones they appear on, their albums and what you could still download. Long lists show ten songs, with the rest a tap away.
  • Tapped songs are fetched, tagged with proper metadata, genres and cover art, and appear in your library in seconds.
  • Import a playlist exported from Spotify or anywhere else: it becomes a real playlist of what you have, and you can download the rest. Your Liked Songs become your favorites instead, in the order you liked them, and the songs you download later join them.
  • The heart on a playlist or an album makes all its songs your favorites, in their order. Songs that already are favorites stay where they are.
  • Library ▸ Songs ▸ Added by you shows only the songs you downloaded or added; All is the whole library. Nobody else sees what you added.
  • A song search cannot find? Library ▸ Songs ▸ Add a song: paste its YouTube link and say what it is. Pick its album from your library or the catalogue, or describe a new one, with its cover.
  • A song saved under the wrong name or artist? An administrator fixes it from its ⋯ menu ▸ Edit details: title, artists, album, year, numbers and genre. Favorites and playlists keep it.

Take it with you

  • Download your favorites, a playlist, an album or single songs. They play from the device, with no request to the server for the audio.
  • A download does not fail because of a bad moment: failed songs are tried again, and what is left carries on by itself after the connection returns or the app reopens. What phones allow in the background has limits.
  • Each song shows whether it is saved, downloading or waiting its turn. Stopping a download keeps what arrived.
  • Downloaded collections stay in sync: songs added to a downloaded playlist or to your favorites are downloaded too. Offline mode in Settings uses only what is on the device.

Make it yours

  • Themes, any accent colour, fonts and text size, what Home shows and in what order, which tabs you get, grid or list.
  • Pin songs, albums, playlists and artists, and give playlists their own cover.
  • Choose a picture for your profile, and let the colours follow the album playing.
  • People: everyone on your server has a profile, like an artist's page, with a cover picture, what they are listening to right now, what they played most this month, their public playlists and their favorites. Pin or copy someone's playlist, or play what they are playing. Anything can be hidden in Settings ▸ Your profile.
  • Jams: listen together with people on your server, each on their own device and in time with the others. Make a Jam public, so anyone can join, or private, for the people you invite. Everyone in it adds songs; you choose whether they can also pause and skip. Several Jams can play at once.
  • Administrators can see and add accounts from Eco, and copy a message with the address, username and password to send the new person.
  • Administrators can delete songs for everyone and review songs held twice, artists that are really several people, and songs with no genre (Eco finds their album's in the catalogue).
  • Statistics: minutes listened, plays, top songs, artists, albums and genres, when people listen, and for administrators who listens to what on the server. Everyone else sees their own.
  • Your files, your server. Navidrome is underneath, so any Subsonic app also works.

How it fits together

Phones and computers in a browser, the desktop app, a Roku TV and Subsonic apps reach Eco over HTTPS. Eco passes audio and library requests to Navidrome, which reads the music folder; asks MusicBrainz and iTunes for song information; lets your devices control each other; and downloads songs with yt-dlp and ffmpeg into the music folder, and podcasts and audiobooks into a folder of their own.

More in docs/architecture.md.

Quick start

You need a machine that is always on (a PC, a Raspberry Pi 4 or newer, a home server, a VPS) with Docker and Docker Compose v2.

mkdir eco && cd eco
curl -fsSLO https://raw.githubusercontent.com/Thrashy190/eco/main/docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/Thrashy190/eco/main/.env.example -o .env
mkdir -p data/music navidrome secrets       # folders the containers use
docker compose up -d

Nothing is built: Eco's image comes ready from ghcr.io/thrashy190/eco (amd64 and arm64), so the folder only holds that file, your .env and your data. Cloning the repository is for working on Eco.

Then:

  1. Open http://localhost:4533 and create your first account. The first user is the administrator.
  2. Open http://localhost:8000. That is Eco. Sign in with the account you just created.
  3. Add some music (see Adding music) and search for it.

Searching beyond your library works right away. Downloading usually needs YouTube cookies, explained below; without them Eco is still a good player.

Prerequisites

You need Why Notes
Docker and Compose v2 runs everything docker compose version should print v2.x
YouTube cookies YouTube blocks anonymous downloads after a while setup. Optional at first
About 1 GB of free RAM, disk for your music At rest, with over 1,000 songs: Navidrome about 150 MB, Eco about 10 MB. Downloads use more while they run

Not using Docker? You need Go 1.22+, Node.js 22.22+ to build the web app, ffmpeg and yt-dlp, plus a running Navidrome. yt-dlp also needs a JavaScript runtime, and that Node.js counts. See Running without Docker.

Configuration

Every setting lives in .env, and docs/configuration.md explains each one and where to get it. The one you will want first:

  • YouTube cookies (YT_COOKIES_BROWSER or secrets/cookies.txt): how to set them up. YouTube blocks anonymous downloads after a while.

Adding music

Use whichever fits you; they all end up in the same library.

Way Good for
The search box in Eco Anything in MusicBrainz: search, tap Get, or open an album and choose its tracks.
Import a playlist, in the app A list exported to a file from Spotify or elsewhere: it becomes a playlist, or your favorites for your Liked Songs, and you can download what is missing.
eco likes Download your whole Spotify Liked Songs or a playlist in bulk, through your own Spotify developer app. See Command line.
Copy files into data/music/ Music you already own. Navidrome scans every minute.
scripts/upload.sh Your own recordings: converts, tags and uploads them.
A YouTube link to a song Library ▸ Songs ▸ Add a song (or paste it in the search box and choose Song): you give its title, artists and album, and it joins your music like any download.
A YouTube link (podcast, audiobook...) Paste it in the search box. Only the audio is kept, apart from your music, in data/media/.
A podcast or audiobook file Podcasts or Audiobooks ▸ a show or book ▸ Add ▸ Upload files: MP3, M4A/M4B, AAC, Ogg/Opus, FLAC or WAV, up to MEDIA_UPLOAD_MAX_MB.
Lidarr (--profile downloads) Whole albums through the *arr stack. Guide.

Downloads land in data/music/YouTube/Artist/Album/NN - Title.m4a, tagged and with a cover.

Podcasts and audiobooks

Podcasts and Audiobooks are sections of their own, reached from the Library or as tabs of their own (Settings ▸ Tabs). Episodes belong to a show and parts to a book, which anyone can make: a title, an author or host, for a book its narrator and series, a description and a picture, framed in the square as you choose it.

Add book takes everything in one page: the details, the cover, and one YouTube link when the whole book is one video, or several when each chapter is its own (they become its parts, in the order given). A playlist link offers to fill them all, one part per video. The cover can be any picture, or the picture of one of its videos; either way you frame it in the square (so are playlist and album covers and your profile picture). Edit book also puts the parts in order (drag them, or use the arrows) and takes more links. A book can list related books (a series, the same world), which show on each other's page. Deleting a book takes its parts with it, after asking.

Add to a show or book in two ways:

  • A YouTube link: paste it into the search box (a single video, not a playlist) and choose Podcast or Audiobook. A podcast goes into the show you choose; an audiobook goes into a book you have, or opens Add book with the link. For a book you have, Edit book also takes more links. Only the audio is downloaded, with the chapters its uploader marked.
  • A file from your device: on the show's or book's page, Add ▸ Upload files. A whole book in one file (an .m4b keeps its chapters and cover), or one file per part: they join in the order of their names. Files go in pieces, so a large book survives a dropped connection.

While one plays, the player changes for it:

Back / forward 30 seconds by default (10 to 60 in Settings), also on the lock screen
Chapters the ones that came with the video or file: previous and next move by chapter, and the list shows each one
Speed 0.5x to 3x in steps of 0.05, remembered for each show or book
Sleep timer also at the end of this chapter
Bookmarks and notes yours alone, unless you share a note with everyone who listens
Where you stopped kept on the server: carry on from another device; after a long pause it steps back a few seconds

Home and your profile show what you are in the middle of. Everything can be saved for offline, a whole book or show at once.

These files live in data/media/<category>/<id>/, not in your music folder, so Navidrome never sees them or mixes them into your artists, albums or shuffled mixes. Eco stores and serves them itself. Only YouTube links are accepted, never other addresses. Anything else imported from a link (talks, lectures, sounds) is under Library ▸ Other audio.

Use it from your phone

Open Eco in your phone's browser and use Add to Home Screen (iPhone: Share, then Add to Home Screen; Android: menu, then Install app). It then behaves like an app.

To reach your server from outside your home you need HTTPS. Options, easiest first, are described in docs/deployment.md: a Cloudflare Tunnel (--profile tunnel), Tailscale, or a reverse proxy of your own. Do not expose the port directly to the internet.

On your computer

Download Eco for Linux, macOS or Windows from the newest release and sign in with your server's address, such as eco.example.com. Any Eco server works. See docs/desktop.md.

On a TV

A Roku TV or stick can run Eco too, installed from your computer with developer mode (no store involved): use it with the remote, or choose it under Listen on to send music there from your phone. See docs/tv.md.

Offline on a phone

Downloads are kept in the app's own private storage (the browser's IndexedDB). They do not appear in the Files app or the photo roll, Settings in Eco shows how much space they use, and removing the app from the home screen deletes them.

A web app cannot download freely in the background. An iPhone freezes it shortly after it leaves the screen, unless music is playing, so a long download there runs while the app is open: Eco keeps the screen on for it, and when you return it carries on from where it was. Nothing is lost when that happens. Whatever is already saved plays at once, even before the whole collection arrives.

Command line

The eco binary is also a toolbox. With Docker: docker compose run --rm eco <command>; without: ./bin/eco <command>.

eco doctor                          # check yt-dlp, ffmpeg, Navidrome, the catalogue, cookies
eco get "https://youtube.com/watch?v=..."     # one YouTube link becomes a tagged song
eco get -q "artist song" URL        # pick the match yourself (-y: take the first, -n: dry run)

# Your Spotify liked songs, step by step (each step can be interrupted and resumed)
eco likes export                    # signs in to Spotify the first time
eco likes search --first 200        # find the YouTube video of your 200 most recent likes
eco likes download                  # fetch every song marked "found"
eco likes favorites                 # mark them as favourites in Navidrome, in the order you liked them
eco likes all                       # every step above

# A Spotify playlist becomes a Navidrome playlist
eco likes all --playlist "My playlist"
eco likes playlist --playlist "My playlist"   # only write its .m3u again ("download" already does it)

eco version                         # which release this is

Your liked songs become your Navidrome favourites, which Eco shows as a Favorites playlist at the top of your library. In Navidrome they stay favourites; real playlists are for Spotify playlists you choose. favorites needs ND_USER and ND_PASS (configuration) and is safe to repeat: songs already favourited are skipped.

eco likes keeps its state in data/likes.csv (or data/playlists/NAME.csv). A song is pending, found, review (needs a human look), downloaded or error; edit the file freely. --limit N processes at most N songs (0 means no limit).

eco likes export opens a browser for the Spotify login, so run it on a machine with a browser; the CSV files it produces can then be used anywhere.

Running without Docker

make tools          # downloads yt-dlp into bin/ (Linux x86_64; elsewhere install it yourself)
make doctor         # tells you what is missing
make run            # http://127.0.0.1:8000

Eco reads .env from the current directory. Point it at your Navidrome with ECO_NAVIDROME_URL (default http://127.0.0.1:4533).

Updating

docker compose pull
docker compose up -d

latest is the newest release. To stay on one, set ECO_IMAGE=ghcr.io/thrashy190/eco:2 in .env (any 2.x) or a full version such as ghcr.io/thrashy190/eco:2.0.0. An ECO_IMAGE set to :1 stays on Eco 1.

Each feature and fix is a release with its notes, numbered with semantic versioning: v1.2.3 is a fix over v1.2.2, v1.3.0 adds something, and v2.0.0 asks you to change something when updating.

yt-dlp changes whenever YouTube does, so the newest release's image is built again every week with the latest yt-dlp. If downloads start failing everywhere, docker compose pull && docker compose up -d usually fixes it.

Troubleshooting

Symptom Try
eco doctor reports something missing Follow the hint it prints.
"Sign in to confirm you're not a bot" YouTube cookies.
"no confident match on YouTube" Eco refused a doubtful video (wrong length or title). Use eco get -q ... URL to pick one by hand.
Searching only shows your library The server cannot reach musicbrainz.org, or it asked Eco to wait a moment; the search says which.
A song or album is not found MusicBrainz is made by volunteers and may not have it yet. Anyone can add it.
A new song does not show up Navidrome scans every minute; give it a moment.
A download for offline says Waiting No connection, or the server is not answering. It carries on by itself.
Wrong username or password Use your Navidrome account: Eco has no accounts of its own.

Development

make check          # gofmt, go vet, go test, TypeScript, web tests and build: the same as CI
make run            # build and serve
make web-dev        # the web app with hot reload, using the eco running on :8000
make roku-install   # the Roku app, on a TV in developer mode (docs/tv.md)
make desktop-dev    # the desktop app from the source (docs/desktop.md)

The Go code lives in cmd/ and internal/; the web app in web/src/ is React and TypeScript, built with Vite and embedded into the binary. The desktop app in desktop/ wraps the same web app with Rust and Tauri. See CONTRIBUTING.md. To report a security problem, see SECURITY.md.

Responsible use

Eco is a tool for managing and playing a personal music library. It downloads audio from YouTube using yt-dlp; doing so may violate YouTube's terms of service and, depending on where you live and what you download, copyright law. You are responsible for what you download and for having the right to do so. Do not use Eco to distribute copyrighted music. Buying music from the artists you love is always welcome.

License

MIT. Use it, change it, share it.

探索相关项目

加载中…