https://github.com/wh0o7/telegrammusicstatus
App for autostatus of music in Telegram
https://github.com/wh0o7/telegrammusicstatus
music-status telegram telegram-status telegrambio
Last synced: 2 months ago
JSON representation
App for autostatus of music in Telegram
- Host: GitHub
- URL: https://github.com/wh0o7/telegrammusicstatus
- Owner: wh0o7
- License: mit
- Created: 2023-08-03T19:31:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-13T10:16:19.000Z (almost 2 years ago)
- Last Synced: 2025-05-12T14:15:43.887Z (about 1 year ago)
- Topics: music-status, telegram, telegram-status, telegrambio
- Language: C#
- Homepage: https://hub.docker.com/repository/docker/wh0o7/telegrammusicstatus/tags
- Size: 278 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TelegramMusicStatus π΅
[](https://github.com/wh0o7/TelegramMusicStatus/blob/main/README.md) [](https://github.com/wh0o7/TelegramMusicStatus/blob/main/README.ru-ru.md)
## Overview πΆ
TelegramMusicStatus updates your **Telegram profile bio** with the track you are playing. It supports **Spotify**, **Last.fm**, and **Yandex Music**. When nothing is playing you can fall back to saved bios and use a slower **wait** polling interval.
**AIMP:** older releases integrated with the AIMP player via a WebSocket plugin ([CurrentlyPlayingInfoAIMPPlugin](https://github.com/wh0o7/CurrentlyPlayingInfoAIMPPlugin) / submodule). That path is **no longer supported** in this repository β use Spotify, Last.fm, or Yandex Music instead.
**Requirements:** [.NET 10 SDK](https://dotnet.microsoft.com/download). SDK version is pinned in [`global.json`](global.json).
## Installation π
**Telegram through a proxy:** [WTelegramClientβs EXAMPLES](https://github.com/wiz0u/WTelegramClient/blob/master/EXAMPLES.md#use-a-proxy-or-mtproxy-to-connect-to-telegram) describe two approaches β this app supports both:
1. **`MTProxyUrl` (simplest)** β set it to a Telegram MTProto proxy URL (`https://t.me/proxy?server=...&port=...&secret=...`). WTelegramClient handles this natively (`Client.MTProxyUrl`).
2. **`Socks5`** β same as upstream: *βSOCKS/HTTPS proxies can be used through the `client.TcpHandler` delegate and a proxy library like [StarkSoftProxy](https://www.nuget.org/packages/StarkSoftProxy/) or [xNetStandard](https://www.nuget.org/packages/xNetStandard/).β* This project uses **`StarkSoftProxy`** (`Socks5ProxyClient`) and your `Socks5` block in `config.json`.
If both are set, **`MTProxyUrl` takes precedence** and `Socks5` is ignored. Omit both for a direct connection.
1. Create `config.json` next to the executable (see the configuration example below). Add `MTProxyUrl` and/or `Socks5` only if you need a proxy.
2. Run the app (`dotnet run` in `TelegramMusicStatus` or a published build). Only configured sources are used.
## Configuration Example ποΈ
JSON uses **PascalCase** property names (`System.Text.Json`). Optional objects can be omitted.
```json
{
"SpotifyApp": {
"ClientId": "your_client_id",
"ClientSecret": "your_client_secret"
},
"SpotifyAccount": {
"BearerToken": "your_spotify_bearer_token",
"Response": null
},
"TelegramAccount": {
"ApiId": "your_api_id",
"ApiHash": "your_api_hash",
"PhoneNumber": "your_phone_number",
"MfaPassword": "your_cloud_password_if_2fa",
"MTProxyUrl": null,
"Socks5": {
"Host": "127.0.0.1",
"Port": 1080,
"Username": null,
"Password": null
}
},
"Settings": {
"IsDeployed": true,
"IsDefaultBioOnPause": false,
"Interval": 45,
"WaitInterval": 90
},
"UserBio": ["Default bio line 1", "Default bio line 2"],
"PlayingIndicator": "π΅ ",
"LastFmApi": {
"ApiKey": "LASTFM_API_KEY",
"Username": "LASTFM_USERNAME"
},
"YandexMusicAccount": {
"Token": "YANDEX_TOKEN"
}
}
```
- `SpotifyApp` π: Spotify API app credentials (also for **SpotifyBearerTokenGetter**). The main app still expects this block; use placeholders if you only use other sources.
- `SpotifyAccount` π΅: Bearer token and/or OAuth `Response`. Use `"Response": null` for token-only mode.
- `TelegramAccount` π¬: `ApiId`, `ApiHash`, phone; `MfaPassword` is the Telegram cloud password if 2FA is enabled. Optional: `MTProxyUrl` (MTProto proxy URL) or `Socks5` β see **Installation** above.
- `Settings` βοΈ: `Interval` β poll interval in seconds (10β300; out-of-range falls back to ~30s). `WaitInterval` β seconds between checks in wait mode when idle (20β600). `IsDeployed` / `IsDefaultBioOnPause` control pause prompts and resetting bio from `UserBio`.
- `UserBio` / `PlayingIndicator`: optional default bios and prefix for the track line.
- `LastFmApi` / `YandexMusicAccount`: optional integrations.
## Spotify Application Registration πΆ
To blend in with Spotify, create an app on the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/applications). Get your Client ID and Client Secret for `SpotifyApp` setup.
## Last.fm Application Registration π΅
To integrate with Last.fm, you'll need to create an application on the [Last.fm Developer Account Registration](https://www.last.fm/api/account/create) page. Once registered, you'll receive your API key for `Last.fm` setup. This key will allow your application to access Last.fm's API for various music-related functionalities.
## Telegram Application Registration π¬
Create an app on [my.telegram.org](https://my.telegram.org/auth) and use `ApiId` and `ApiHash` in `TelegramAccount`.
## Usage π
1. Fill in `config.json`.
2. Run **TelegramMusicStatus** (and **SpotifyBearerTokenGetter** when you need a new Spotify token).
3. Your Telegram bio updates from the first source that reports "now playing".
## Contributing π€
Open to suggestions! Feel free to raise issues or make pull requests on [GitHub](https://github.com/wh0o7/TelegramMusicStatus/issues).
## Questions or Feedback? π€
If you have any questions or want to provide feedback, you can reach out to me in the [wh0o7 heaven chat](https://t.me/+D-T_xElzA003Nzcy). Let's make the project even better together! π΅π
## Used Libraries π
- [WTelegramClient](https://github.com/wiz0u/WTelegramClient) β Telegram MTProto client
- [StarkSoftProxy](https://www.nuget.org/packages/StarkSoftProxy/) β SOCKS5 via `TcpHandler` when `Socks5` is set
- [SpotifyAPI-NET](https://github.com/JohnnyCrazy/SpotifyAPI-NET) β Spotify Web API
- [Yandex.Music.Api](https://github.com/K1llMan/Yandex.Music.Api) β Yandex Music API
- [Last.fm](https://github.com/avatar29A/Last.fm) β Last.fm client
- [Improved Console](https://github.com/litolax/Improved-Console) β console logging helpers
## License π
This project rocks the [MIT License](LICENSE).