Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Hello friends,
I will be jumping right to the issue I am having for a while. I have built a GUI software with Python 3.6 with PyQt5 and the latest version of youtube-dl, for windows. The software downloads files in mp4, 3gp, m4a and webm extensions with no problems at all, and mp3 with the upcoming issue. So what it basically does, is that while it downloads it as mp3, by the time it converts it with ffmpeg (same issue with ffprobe), a console window pops right out of the GUI and does its magic. I have made all the necessary customizations in the code, such as to run the ffmpeg with verbose etc but it will not go away. Changing the file extension from .py to .pyw does not help either. It downloads it fine no problems with that, it is just a bit annoying for a GUI to pop a window console like that out of nowhere.
Here is the console I get during the convert when I download a URL as mp3 (this pops like that until it finishes the conversion to mp3 and then disappears):
And here is the function with the options responsible for that (for other extensions, the code is similar with just few name changes but ffmpeg is not necessary for them in order to convert (I know you already know that of course)):
def youtubeMP3(self):
options = {
'format': 'bestaudio/best',
'extractaudio': True,
'audioformat': 'mp3',
'outtmpl': self.location + '/%(title)s-%(id)s.%(ext)s',
'quiet': True,
'no_warnings': True,
'nocheckcertificate': True,
'progress_hooks': [self.hookMP3],
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192'
}]
}
value = self.urlText.text()
if value != "" and validators.url(value):
with youtube_dl.YoutubeDL(options) as ydl:
try:
ydl.download([value])
self.progressLabel.setText("The download was successful.")
self.urlText.clear()
time.sleep(5)
self.progressLabel.setText("")
except:
self.progressLabel.setText("This video URL does not exist.")
self.urlText.clear()
time.sleep(5)
self.progressLabel.setText("")
Please excuse the indentation issue here.
I really do not know if it that is a bug or something else, maybe a windows related problem, but thought I could share it here and maybe I can solve it as well... It is a project I developed a couple months back, it is not latest youtube-dl version related, options seem okay as well.
Thank you for reading this and sorry if I went on for too long.