Skip to content

A Telegram bot that fetches the currently playing song from Last.fm and posts details about the song to a specified channel.

License

Notifications You must be signed in to change notification settings

Burhanverse/Tunified

Repository files navigation

TunifiedNXT

A Telegram bot to fetch the currently playing song from Last.fm and shares it on Telegram.

Available at TunifiedNXT


Preview:

Features:

  • Fetches the now playing song from Last.fm.
  • Utilizes YTMusicAPI to get the required CoverART for the tracks.
  • Posts the song details to a Telegram channel.
  • Updates the post every 5 seconds to reflect the current song (channels only).
  • Supports multiple channels.
  • Supports group chats.

Prerequisites & Setup:

  • Node.js v18+ installed.
  • Python 3.11+ installed.
  • Telegram Bot API token.
  • MongoDB for database.
  • Last.FM client installed in your phone for scrobbling tracks (it is recommanded to use pano scrobbler if you are on Android).
  • Last.fm API key, Shared secret and username.
  • Telegram Channel ID.

1. Download and install Node.js.

2. Clone the repository:

    git clone https://github.com/Burhanverse/Tunified.git
    cd Tunified

3. Install dependencies:

    npm install --include=dev

4. Create a .env file in the root directory and add the following environment variables:

LASTFM_API_KEY=
LASTFM_SHARED_SECRET=
TELEGRAM_BOT_TOKEN=
MONGO_URI=

5. Get your Last.FM API KEY & SHARED SECERT from here remember to login with the same account you use for scrobbling tracks as this will serve as the main source for the bot to display the current playing track data.

6. Add the bot @myidbot to your chat or channel → send the command /getgroupid@myidbot and follow the instructions in the bot.

7. To get TELEGRAM_BOT_TOKEN, go to chat with @BotFather and send the command /newbot. Following the instructions. Upon completion, @BotFather will give you the bot token. Don't forget to add the bot to your channel.

8. Create a mongodb cluster for database.

9.Start the bot:

python3 -m venv venv
source venv/bin/activate
    npm start

About

A Telegram bot that fetches the currently playing song from Last.fm and posts details about the song to a specified channel.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published