To play music on YouTube in background on a mobile device requires YouTube Premium. Let's just set Telegram as our YouTube music player!
The idea is simple and straightforward. Firstly, apply a telegram bot and secure its token. Secondly, write a bot program that accepts one YouTube URL at a time from telegram user. Next, invoke youtube-dl
to get the download URL of the best quality audio. Finally, send the downloaded audio file to corresponding telegram user.
![](/wp-content/uploads/2020/12/pngout-1-906x1024.png)
The project is on my GitHub: https://github.com/BlueCocoa/youtube-music-bot
Continue reading OK Google, set Telegram as my YouTube music player!