This python code download a video from youtube as mp3 and add it to the
iTunes Library.
git clone https://github.com/abdullah-saadeddin/Youtube-To-iTunes.git
cd youtube-to-iTunes
pip install -r requirements.txt
python main.py
I use the pytube Library to get the video from youtube using its URL, download the standard Quality of the video and get the thumbnail, the Library doesn't offer an mp3 file so I use the moviepy Library to convert the video to an mp3 file format after that, I downloaded the thumbnail using requests Library and finally add it to the mp3 file using eyed3 after all that the mp3 file moved to the iTunes Music Library folder which will sync it to iTunes.