{"id":28500141,"url":"https://github.com/ebertek/bjornify","last_synced_at":"2026-02-18T10:10:25.577Z","repository":{"id":291093199,"uuid":"976537409","full_name":"ebertek/bjornify","owner":"ebertek","description":"Björnify is a Discord bot that adds requested tracks to the Spotify playback queue.","archived":false,"fork":false,"pushed_at":"2025-11-18T09:41:22.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-18T10:19:26.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebertek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-02T09:36:56.000Z","updated_at":"2025-11-18T09:36:26.000Z","dependencies_parsed_at":"2025-05-02T11:43:36.990Z","dependency_job_id":"25ba2b0b-7a20-4e85-9bc6-3963d43c30f9","html_url":"https://github.com/ebertek/bjornify","commit_stats":null,"previous_names":["ebertek/bjornify"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ebertek/bjornify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebertek%2Fbjornify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebertek%2Fbjornify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebertek%2Fbjornify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebertek%2Fbjornify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebertek","download_url":"https://codeload.github.com/ebertek/bjornify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebertek%2Fbjornify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29575401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-06-08T15:06:01.356Z","updated_at":"2026-02-18T10:10:25.572Z","avatar_url":"https://github.com/ebertek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎵 Björnify\n\nBjörnify is a Discord bot based on [discord.py](https://github.com/Rapptz/discord.py) that adds requested tracks to your Spotify playback queue.\n\n## 🧠 How It Works\n\n- Listens for `!add`, `!next`, `!pause`, and `!np` commands.\n- Uses [Spotipy](https://github.com/spotipy-dev/spotipy) to search tracks and manage playback via Spotify Web API.\n- Queues tracks or starts playback if nothing is playing.\n- Falls back to controlling Sonos speakers via [SoCo](https://github.com/SoCo/SoCo) if Spotify playback fails due to device restrictions.\n- Uses autocomplete and dropdown UI for enhanced slash command experience (`/add`).\n\n## 🚀 Usage examples\n\n### 💬 Text commands\n\n- 🎶 `!add Souvlaki Space Station` — Add the first track that matches your query\n- 🧩 `!add track:Anti-Hero album:Midnights artist:Taylor Swift year:2022` — Add a track using detailed filters\n- ⏭️ `!next` — Skip to the next track\n- ⏸️ `!pause` — Pause playback\n- 🎧 `!np` — Show the currently playing track\n\n### 🧵 Slash commands\n\nThese are visible only to you and provide autocomplete support:\n\n- 🔍 `/add` — Search for tracks and add the selected one to the queue\n- ⏭️ `/next` — Skip to the next track\n- ⏸️ `/pause` — Pause playback\n- 🎧 `/np` — Show the currently playing track\n\n## 🧩 Docker Compose\n\n### `compose.yaml`\n\n```yaml\n---\nname: bjornify\n\nservices:\n  bjornify:\n    container_name: bjornify\n    cpu_count: 1\n    deploy:\n      resources:\n        limits:\n          # cpus: \"1\"\n          memory: 250M\n    env_file: bjornify.txt\n    environment:\n      TZ: Europe/Stockholm\n    hostname: bjornify\n    image: \"ghcr.io/ebertek/bjornify:latest\"\n    restart: \"no\"\n    stop_grace_period: 3m\n    user: \"1028:100\"\n    volumes:\n      - \"/mnt/docker/bjornify/logs:/app/logs\"\n      - \"/mnt/docker/bjornify/secrets:/app/secrets\"\n```\n\n### `bjornify.txt`\n\n```shell\nSPOTIPY_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nSPOTIPY_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nSPOTIPY_REDIRECT_URI=http://localhost:3000\nDISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nCHANNEL_ID=xxxxxxxxxxxxxxxxxxx\nGUILD_ID=xxxxxxxxxxxxxxxxxxx\nDEFAULT_DEVICE=Everywhere\nLOG_OUTPUT=console\nLOG_LEVEL=INFO\nLIB_LOG_LEVEL=ERROR\nHASS_DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nHASS_CHANNEL_ID=xxxxxxxxxxxxxxxxxxx\nHA_URL=https://hass.local/api/conversation/process\nHA_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\n### 🔐 Environmental variables\n\n| Variable Name           | Description                                                                            |\n| ----------------------- | -------------------------------------------------------------------------------------- |\n| `SPOTIPY_CLIENT_ID`     | Your Spotify app’s client ID used for API authentication.                              |\n| `SPOTIPY_CLIENT_SECRET` | Your Spotify app’s client secret.                                                      |\n| `SPOTIPY_REDIRECT_URI`  | Redirect URI registered with your Spotify app.                                         |\n| `DISCORD_BOT_TOKEN`     | Token for Björnify to access the Discord API.                                          |\n| `CHANNEL_ID`            | Discord channel ID where Björnify listens for `!` commands.                            |\n| `GUILD_ID`              | Optional: Discord guild ID where Björnify listens for `/` commands.                    |\n| `DEFAULT_DEVICE`        | Optional: Device used to start playback if no devices are currently playing.           |\n| `LOG_OUTPUT`            | Optional: Comma-separated list to configure logging destinations: `console, file`.     |\n| `LOG_FORMAT`            | Optional: `plain` for human-readable, `json` for JSON.                                 |\n| `LOG_LEVEL`             | Optional: Log level for Björnify: `DEBUG` \u003e `INFO` \u003e `WARNING` \u003e `ERROR` \u003e `CRITICAL`. |\n| `LIB_LOG_LEVEL`         | Optional: Log level for `asyncio`, `discord`, `soco`, `spotipy`, and `urllib3`.        |\n\nTo get your own Spotify Client ID and secret, please create a new app using the [Spotify for Developers](https://developer.spotify.com/dashboard) Dashboard. You can add `http://localhost:3000` to _Redirect URIs_, and select `Web API` for _APIs used_.\n\nTo get your own Discord token, please create a new application using the [Discord Developer Portal](https://discord.com/developers/applications). You will need the `bot` and the `applications.commands` scopes. Under _Bot permissions_, you will need to check `View Channels`, `Send Messages`, `Add Reactions`, `Read Message History`, and `Use External Emojis`.\n\n### 💾 Persistent volumes\n\n| Volume         | Description                       |\n| -------------- | --------------------------------- |\n| `/app/logs`    | Location of logs                  |\n| `/app/secrets` | Location of `spotipy_token.cache` |\n\n### 🤖 Home Assistant conversation bot\n\nA second bot, `hass.py` is also included in this image. It sends text to Home Assistant’s conversation API. If you want to use it, please create a second application using the [Discord Developer Portal](https://discord.com/developers/applications). You will also need to configure the following environmental variables in `bjornify.txt`:\n\n| Variable Name            | Description                                                             |\n| ------------------------ | ----------------------------------------------------------------------- |\n| `HASS_DISCORD_BOT_TOKEN` | Token for the Home Assistant conversation bot.                          |\n| `HASS_CHANNEL_ID`        | Discord channel ID for Home Assistant conversation bot commands.        |\n| `HA_URL`                 | URL to your Home Assistant’s `/api/conversation/process` endpoint.      |\n| `HA_ACCESS_TOKEN`        | Long-lived Home Assistant access token for authenticating API requests. |\n\n## 🐳 Docker\n\nAs an alternative to Docker Compose, you can simply run the container using `docker run`:\n\n```shell\ndocker run --name bjornify \\\n  --cpus=\"1.0\" \\\n  --memory=\"250m\" \\\n  -e SPOTIPY_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\\n  -e SPOTIPY_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\\n  -e SPOTIPY_REDIRECT_URI=http://localhost:3000 \\\n  -e DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\\n  -e CHANNEL_ID=xxxxxxxxxxxxxxxxxxx \\\n  -e GUILD_ID=xxxxxxxxxxxxxxxxxxx \\\n  -e DEFAULT_DEVICE=Everywhere \\\n  -e HASS_DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\\n  -e HASS_CHANNEL_ID=xxxxxxxxxxxxxxxxxxx \\\n  -e HA_URL=https://hass.local/api/conversation/process \\\n  -e HA_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\\n  -e TZ=Europe/Stockholm \\\n  --hostname bjornify \\\n  --restart=no \\\n  --stop-timeout=180 \\\n  --user 1028:100 \\\n  -v /mnt/docker/bjornify/logs:/app/logs \\\n  -v /mnt/docker/bjornify/secrets:/app/secrets \\\n  ghcr.io/ebertek/bjornify:latest\n```\n\n## 🐞 Submitting Issues\n\nIf you encounter a problem, feel free to [open an issue](https://github.com/ebertek/bjornify/issues). Please include the following to help us investigate:\n\n- A description of the issue and how to reproduce it\n- What command you used (e.g. `/add` or `!next`)\n- The relevant section of the debug logs from `/app/logs/bjornify.log` (set `LOG_OUTPUT` to `file`, and `LOG_LEVEL` and `LIB_LOG_LEVEL` to `DEBUG`)\n\nLogs help tremendously with diagnosing errors. If possible, redact any personal information (like tokens or private names).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febertek%2Fbjornify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febertek%2Fbjornify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febertek%2Fbjornify/lists"}