Skip to content

Instantly share code, notes, and snippets.

@DevER-M
Created January 16, 2026 06:56
Show Gist options
  • Select an option

  • Save DevER-M/a52b363b21093d8d285fb86c4aa098b5 to your computer and use it in GitHub Desktop.

Select an option

Save DevER-M/a52b363b21093d8d285fb86c4aa098b5 to your computer and use it in GitHub Desktop.
A guide on how to use beets, a media library manager

Basic configuration

  • Discogs for metadata is recommended so get an api key for it
  • Discogs adds a cover_art_url column in the db which fetchart can use instead of doing another new request from cover art archive/any other
  • When importing using beets do beet import -t YOURALBUM this will always ask on whether if the metadata is ok
image image image
  • Use Foobar2000 or harmonoid for synced lyrics
  • To install plugins install beets[lyrics,discogs,fetchart,embedart,scrub]

config.yaml

directory: ~/Music/library
library: ~/Music/library/musiclibrary.db

import:
  copy: yes
  move: no
  write: yes
  log: ~/.config/beets/import.log

plugins:
  - lyrics
  - fetchart
  - embedart
  - scrub
  - discogs

discogs: 
  user_token: <YOUR DISCOGS API TOKEN HERE>

fetchart:
  auto: yes
  maxwidth: 1500
  max_filesize: 100000
  sources: cover_art_url

embedart:
  auto: yes

lyrics:
  synced: yes
  sources: [lrclib, genius]

paths:
  default: $albumartist/$album/$track $title
  singleton: Singles/$artist/$title
  comp: Compilations/$album/$track $title

art_filename: cover

Useful SQL Queries

  • Shows Albums which have missing tracks
select id,title,album,artist from items group by album having tracktotal!=count(track);
  • Shows Tracks which have missing lyrics
select id,title,album,artist from items where lyrics='';
  • If manually doing changes in the database make sure to do beet write

Find Lyrics That Are not In Any Default Sources (lyrics plugin)

  • In the environment where beets is installed install syncedlyrics (with pip)
  • Now you can run this script and add the missing lyrics
#add_lyrics.py

import sqlite3
import syncedlyrics

conn = sqlite3.connect(input("enter the path to musiclibrary.db file: "))
cur = conn.cursor()
cur.execute("select id,title,album,artist from items where lyrics=''")
lyrics_missing=cur.fetchall()
print("missing lyrics in: ",lyrics_missing)

for track in lyrics_missing:
   lyrics=syncedlyrics.search(track[1],synced_only=True)
   print(lyrics)
   if input("is this lyrics ok? if not abort(y/n): ")=="y":
       cur.execute("update items set lyrics = ? where title = ?",(lyrics,track[1]))
   else:
       conn.commit()
       conn.close()
       exit()
conn.commit()
conn.close()
  • Run beet write to update the files with the new lyrics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment