Skip to content

Armiixteryx/musiclinksconverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

MusicLinksConverter

Description

This is a Telegram bot to convert links between Deezer and Spotify.

This bot relies on tbot crate to establish the connection to Telegram API. tbot relies on tokio which is a runtime to async Rust.

I consume the Deezer and Spotify Web API manually.

Q: But why you consume the Spotify API manually if there are so many Spotify crates that do it?

R: For learning purposes.

Q: And for Deezer API?

R: The same reason :)

What does it convert?

This bot currently converts:

  • Songs.

  • Albums.

  • Artists.

Running

  • Clone this repository.

Tbot configuration

  • Register a new Telegram bot. Then export a variable named BOT_TOKEN with the Telegram token:

In bash:

export BOT_TOKEN="TOKEN"

Bot configuration

Spotify

Spotify requires a registered app to make calls to its API.

export BOT_SPOTIFY_CLIENT_ID="CLIENT_ID"

export BOT_SPOTIFY_CLIENT_SECRET="CLIENT_SECRET"

Deezer

Deezer API allows to use its public data without regist an app.

Deezer is good.

Be like Deezer :)

Compilation

  • If you just want to use this bot, you should compile with the release option:

cargo build --release

It will last so much time because of Rust and LLVM optimizations.

  • If you want to hack, compile without optimization:

cargo build

The compilation in this case will be faster.

Running

cargo run

Actual state

This bot is in ALPHA state.

Currently, if a link is malformated the bot will panic without sending a error response to the user. However, the bot will still working because tokio (the async machine used by tbot) will remain active.

I am refactoring the code in error_handling branch to handle errors properly.

About

A bot for music links convertion in Telegram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages