Read This Article
Hello, welcome to Modzmultiverse, today we are going to tell you the best method to play YouTube Music in android in background on any using Termux.
Need of this system.
Why to use this method over YouTube, YouTube-Vanced, or any other music streaming app1. Because official YouTube doesn't support background play.
2. YouTube-Vanced supports background play but loads video, so it takes much more data and in some mobiles it shows error during installation.
3. Music streaming apps are just an advertising billboard, and sometimes we can't find our favorite Remix, Mashup, slow and reverb version of your favorite song, or Medley on music streaming apps due to copyright issues. And there are lots of small YouTubers who make a lot of slow and reverb but cant distribute music to streaming platforms because of distribution charges. Therefore, YouTube is the best source for different styles of music.
4.you can use it to flex your skills in front of friends.
5.if you are a tech-savvy Linux user or CLI obsessed, then definitely you will love the CLI music player.
Requirements
1. Android or any Linux Device or windows2.a Google account
So let's start by setting up the system.
For Windows, Linux Start from Start Step 2.
Step 1 (Only For Android).
For Android install, Termux from Google Plays Store or F-droid.Step 2.
Now we need to install python.For installing python in Android.
Open Termux
After opening the Termux app, the screen will look something like this.
After opening the Termux, write the below command to install python.
"apt update && apt upgrade"
press 'y' every time it asks you to press 'y' to continue.
"apt install python"
It will ask you to press 'y' for installation, to proceed press 'y' and after the installation the screen will look something like this.
For installing python on Windows, you can download the official Executable File from official Python Website to Download the Python setup file based on your windows architecture. Otherwise, it will conflict with your operating system.
During installation, please check the option 'add python to path' option to access it from command line.
Step 3 (Python Installation)
For installing python on Linux.
Mainly all the Linux Distros Ship with Python Installation By Default, but if you can't find it, you can use the shell to install it by using the following command."Sudo apt-get update"
"sudo apt-get install python"
To check if python is installed or not, use the following command on any of the OS i.e. Linux/Windows/android with Termux.
"Python3 --version"
after the installation of python, we need to install "Mps-youtube" and youtube-dl
To install it, use the below command in Termux for android, in command line (i.e. CMD) for windows in terminal for Linux.
"pip install mps-youtube"
"pip install -U youtube-dl"
step4 (Only for android)
after the installation of Mps-youtube we need to install VLC player for Termux.
Use the below command to install VLC player on Termux.
"apt install vlc"
Press "y" and click the enter or send key on your keyboard to continue the installation.
use the below code to check the installation of vlc media player.
"vlc --version"
The output will be something like this.
Steps 5 (making a Google cloud YouTube API authentication key)
1. Go to https://developers.google.com/ and log in or create an account, if necessary.
2. After logging in go to this link https://console.developers.google.com/project project and click on the blue CREATE PROJECT button as depicted in the photo below. Wait a moment as google prepares your project.
3. Fill in whatever Project Name you want.
4. Then click Google APIs link in the top left corner and then click the link option called "YouTube Data API." It's under YouTube API's. You can see it highlighted in the photo below, bottom right.
5. Now click on the "ENABLE" button.
6. Next, click on the blue 'Go to Credentials' button to the right.
7. Choose the select option YouTube Data API v3 for the first select option and Web server (e.g. node JS. Tomcat) for the second selection. Then choose Public data. Now click the blue button, "What credentials do I need?."
8. Almost done, wait for Google to create your new project, and you should see the screen below where you can copy your API Key.
STEP 6 (Setting up API key)
now open mps-youtube by using the following command.
"mpsyt"
now the screen will look something like this.
now we have to set our api key, for that we will use.
set api_key <your api key>
now we have to set player as vlc
"set player vlc"
now we are good to go
for searching any song, you can use "/"
Like I want to search a song "gerua", i will use "/gerua" it will list all the songs it found, we can use the "num" key to play it.
Hope you like the article, if you have any queries please comment. Your queries, I will resolve all your queries, and in the next article I will bring command related to mpsyt.
