0

I wanted to make my program that takes Youtube video, downloads and then converts mp4 video to mp3 audio. When it gets to converting part it gives a TypeError: 'str' object is not callable.

I've tried different libraries but decided to use moviepy.

Here's the code itself

yt = YouTube(str(input("Link to video: ")))

videos = yt.streams.get_by_itag("140")
print(videos)

videos.download(r"C:\Users\User\Desktop\Python\Youtube to MP3\Videos")

ToConvert = VideoClip(r'C:\Users\User\Desktop\Python\Youtube to MP3\Videos\%s%s' %(yt.title, '.mp4'))
mp3file = ToConvert.audio
mp3file.write_audiofile(r'C:\Users\User\Desktop\NewAudio.mp3')
Redlik
  • 439
  • 1
  • 4
  • 6

0 Answers0