0

anyone can help me with changing save location of a mp3 file created via moviepy?

from pytube import YouTube
from pytube import Playlist
from moviepy.editor import *

url = input()
ytd = YouTube(url)
stream = ytd.streams.first().download()
name = ytd.title + '.mp4'
mp4_file = name
mp3_file = ytd.title + '.mp3'
videoClip = VideoFileClip(mp4_file)
audioClip = videoClip.audio
audioClip.write_audiofile(mp3_file)
audioClip.close()
videoClip.close()

This saves mp3 file at a root of my .py I am running, however I want it to be saved to my music library and cant find any information on how to do this.

tuto108
  • 25
  • 1
  • 7

1 Answers1

0

audioClip.write_audiofile("C:/Users/unknown/Desktop/movie/temp.mp3")

set fullpath for the your audio file

nithin
  • 26
  • 3