Package: tg_odesli_bot
Telegram Odesli BotSend a song link in any (supported) music streaming service and get back
a message with links in other services.Add in Telegram:@odesli_botIt's useful but still work in progress. Some turbulence is expected.What is it for?You love to share music with your friends (or be shared with), but you
settled in different streaming services? With the help of this bot you
can share any song link to the Bot and get all other links back in
reply.Powered by the greatOdesli(former Songlink) service.You can message the bot directly, invite it to group chats or use an inline
mode (type@odesli_bot <URL>). In group chats the bot will react only to
messages with music streaming links (it will also skip messages marked with
special token!skip). You can promote the bot to a group admin and it
will remove original message so that the chat remains tidy.Original messageBot's replayFeaturesInline modeInline search modePrivate chat modeGroup chat modeSupported servicesCurrently, the following services are supported:DeezerGoogle MusicSoundCloudYandex MusicSpotifyYouTube MusicYouTubeApple MusicTidalNote that bot doesn't react to YouTube links in group chats. Reasons arehere.Privacy considerationsThe bot have to have access to messages in group chats to operate (that
is, it operates with disabledprivacy
mode). It does not store
nor transfer messages anywhere. However, the only way to be completely
private is to read through source code in this repositoryandrun
your copy of the bot (see section below). Or simply create a special
group only for music sharing and where no sensitive information will be
posted.Running your own copyPrerequisitesYou need a Telegrambot
tokento run
your copy of the bot. Don't worry, it can be obtained easily. Follow theinstructionsto create a
new bot (you can set a name and a username to whatever you want). All you
need is a string like110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw-
this is your new bot token.Additionally, disable privacy mode for your bot in a dialog with
@BotFather: "Group Privacy" - "Turn off" (that is for the bot to be able
to read group messages).Bot from this repository will looks forTG_ODESLI_BOT_TG_API_TOKENenvironment variable on start, thus you must set it either in shell or
via.envfile:$echo"<your_token>">.env$# OR$TG_ODESLI_BOT_TG_API_TOKEN=<your_token><bot_run_command(seebelow)>Ones you obtain a Telegram bot token, you can run bot using either Python
(3.10 or 3.11) or Docker.Run PyPI versionCreate virtual environment, installtg-odesli-botpackage and run the bot
withtg-odesli-botcommand:$python-mvenvbotenv$sourcebotenv/bin/activate$pipinstalltg-odesli-bot$TG_ODESLI_BOT_TG_API_TOKEN=<your_token>tg-odesli-botRun with DockerSetTG_ODESLI_BOT_TG_API_TOKENenvironment variable and run the image9dogs/tg-odesli-bot(in order to use the.envfile, mount it to/opt/tg-odesli-bot/.env):$dockerrun--rm-it-v/path/to/.env:/opt/tg-odesli-bot/.env9dogs/tg-odesli-bot#OR$TG_ODESLI_BOT_TG_API_TOKEN=<your_token>dockerrun-it--rm9dogs/tg-odesli-botRun version from the repositoryClone this repository,install
poetry, copy.envfile
into the project's root directory and run the bot:$gitclonehttps://github.com/9dogs/tg-odesli-bot.git&&cdtg-odesli-bot#Installdependencies$poetryinstall#Ifyouhavetokenin.envfile$cp/path/to/.env./$poetryruntg-odesli-bot#Ifyouspecifytokenviashellenvvar$TG_ODESLI_BOT_TG_API_TOKEN=<your_token>poetryruntg-odesli-botContributingContributions are welcome via GitHub pull requests. The easiest way to bootstrap
development environment is to buildbuildertarget of Docker image:$gitclonehttps://github.com/9dogs/tg-odesli-bot.git&&cdtg-odesli-bot$dockerbuild-t9dogs/tg-odesli-bot:dev--target=builder--build-argpoetry_args=.Then you can run a shell inside the container:$dockerrun-it--rm-v%cd%:/opt/tg-odesli-bot-v/opt/tg-odesli-bot/.venv9dogs/tg-odesli-bot:devbash(container)$makelinttest