I have "written" a python program that downloads the audio of a YouTube video in mp3 format. The downloading procedure works fine but I can only listen to the songs on my windows laptop. I would like to synchronize these songs with iTunes (download-able in MS store) so I can listen to them on my iphone. Whenever I try to drag the songs into the iTunes album directory it does not work and it shows a black circle with a diagonal line in it. I tried to play the songs on my iphone by uploading them to wetransfer and downloading them to my device. The slider moved from left to the ride but you could not hear anything. Could you help me please I have also enabled the one crucial option in the iTunes application but this had no impact on the functionality. Could some unnecessarily saved meta data prevent me from importing them to itunes library? (In my country it is totally legal to download music from yt if it is for the private use.)
Here is the code:
import youtube_dl
def get_mp3():
video_info = youtube_dl.YoutubeDL().extract_info(
url = input("Enter video URL: "), download = False
)
options = {
'format': 'bestaudio/best',
'keepvideo': False,
'outtmpl': f"{video_info['title']}.mp3",
}
with youtube_dl.YoutubeDL(options) as ydl:
ydl.download([video_info['webpage_url']])
get_mp3()