Broken mp3 filename
Closed this issue · 3 comments
I am not sure if this is a new thing or a bug.
Previously I was doing this to download the video as an mp3 with a filename:
file_name = "test"
yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk")
ys = yt.streams.get_audio_only()
ys.download(output_path=self.DOWNLOAD_PATH, filename=file_name, max_retries=1, mp3=True)
# This would produce a file called test.mp3
This stopped working, it would not rename the file, to fix I had to do this:
file_name = "test.mp3" # Had to add .mp3
yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk")
ys = yt.streams.get_audio_only()
ys.download(output_path=self.DOWNLOAD_PATH, filename=file_name, max_retries=1) # Had to remove mp3=True
# This would produce a file called {video title}.mp3
I am not sure if this is a new thing or a bug.
Previously I was doing this to download the video as an mp3 with a filename:
file_name = "test" yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk") ys = yt.streams.get_audio_only() ys.download(output_path=self.DOWNLOAD_PATH, filename=file_name, max_retries=1, mp3=True) # This would produce a file called test.mp3
This stopped working, it would not rename the file, to fix I had to do this:
file_name = "test.mp3" # Had to add .mp3 yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk") ys = yt.streams.get_audio_only() ys.download(output_path=self.DOWNLOAD_PATH, filename=file_name, max_retries=1) # Had to remove mp3=True # This would produce a file called {video title}.mp3
which version of pytubefix?
@JuanBindez 1.10.0, it must have broke in the past couple of months
I am not sure if this is a new thing or a bug.
Previously I was doing this to download the video as an mp3 with a filename:
file_name = "test" yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk") ys = yt.streams.get_audio_only() ys.download(output_path=self.DOWNLOAD_PATH, filename=file_name, max_retries=1, mp3=True) # This would produce a file called test.mp3
This stopped working, it would not rename the file, to fix I had to do this:
file_name = "test.mp3" # Had to add .mp3 yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk") ys = yt.streams.get_audio_only() ys.download(output_path=self.DOWNLOAD_PATH, filename=file_name, max_retries=1) # Had to remove mp3=True # This would produce a file called {video title}.mp3
It worked normally here, try this way
from pytubefix import YouTube
file_name = "test"
yt = YouTube("https://www.youtube.com/watch?v=j48Uhvc_hlk")
ys = yt.streams.get_audio_only()
DOWNLOAD_PATH = "pass the way here"
ys.download(output_path=DOWNLOAD_PATH, filename=file_name, max_retries=1, mp3=True)
# This would produce a file called test.mp3