Skip to content

Telegram bot that download the song at the provided URL and upload it somewhere via SFTP

License

Notifications You must be signed in to change notification settings

nathmo/TelegramSongDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Song Downloader

Telegram that download the song at the provided URL and upload it somewhere via SFTP

Disclaimer

Downloading copyrighted song is illegal in some countrys. check your local regulation and dont do anything illegal.

Use Case

You have a NAS and you're not a big fan of not having a local copy of your music with you. But manually downloading, renaming and filling metadata for your song is a tedious process This tool does just that. It is still up to you to sync your music accross your device from your NAS (in my cas the NAS is a RockPro64 with a bunch of harddrive running openmediavault, i use FolderSync on android to sync it and this app is hosted on a raspberry pi)

Usage

Paste the link to the video you want to get the audio track when promted give it a name (the program try to find the correct but in the case its wrong you can enter it manually) wait and enjoy for your music to be send to the SFTP server (your NAS for instance)

image

Normal Installation on debian like linux

Cloning the repo

git clone https://github.com/nathmo/TelegramSongDownloader.git

cd TelegramSongDownloader

Installings dependencies

sudo apt-get install python3, ffmpeg, python3-pip

pip3 install -r requirements.txt

Running

python3 TelegramMusic.py SFTPHOST SFTPPORT SFTPUSERNAME SFTPPASSWORD REMOTEPATHTOMUSICFOLDER CLIENTELEGRAMID BOTTELEGRAMID

(do not change the order of the value)

SFTPPASSWORD this is your ssh password
SFTPUSERNAME this is your ssh username
SFTPHOST this is the SFTP Host (any server with SSH enabled will do)
SFTPPORt this is the SFTP port of the server (usually 22)
SFTPREMOTEBASEPATH replace this value with the absolute path where you want to store the song on your server
TELEGRAMID this is the telgram id of the account that will use this app. you can find it [there](https://www.technobezz.com/how-to-find-user-ids-in-telegram/)
TELEGRAMBOTTOKEN replace with the value you get using the [bot Father](https://www.telegram-group.com/en/blog/create-bot-telegram/)

Docker Installation from source

Cloning the repo

git clone https://github.com/nathmo/TelegramSongDownloader.git

cd TelegramSongDownloader

Installings dependencies

curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

sudo usermod -aG docker pi

docker volume create portainer_data

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Building the image

Edit the settings and fill the followings value :

nano Dockerfile

SFTPPASSWORD="" this is your ssh password
SFTPUSERNAME="" this is your ssh username
SFTPHOST="" this is the SFTP Host (any server with SSH enabled will do)
SFTPPORT="" this is the SFTP port, usually 22
SFTPREMOTEBASEPATH="" replace this value with the absolute path where you want to store the song on your server
TELEGRAMID="" this is the telgram id of the account that will use this app. you can find it [there](https://www.technobezz.com/how-to-find-user-ids-in-telegram/)
TELEGRAMBOTTOKEN="" replace with the value you get using the [bot Father](https://www.telegram-group.com/en/blog/create-bot-telegram/)

docker build -t telegrammusic .

Running

either lauch it using a docker command or connect to 127.0.0.1:9000 on the portainer interface and use that to execute the container

docker run telegrammusic

Docker Installation from dockerhub

docker run nathmo/telegrammusic

Compatibility

System Python Version DockerVersion
Ubuntu 20.04 amd64 Working untested
raspios armf64 untested Working

About

Telegram bot that download the song at the provided URL and upload it somewhere via SFTP

Resources

License

Stars

Watchers

Forks

Packages

No packages published