Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python with PyQt5 GUI FFMPEG Issue #16890

Closed
Goblinb opened this issue Jul 2, 2018 · 1 comment
Closed

Python with PyQt5 GUI FFMPEG Issue #16890

Goblinb opened this issue Jul 2, 2018 · 1 comment

Comments

@Goblinb
Copy link

@Goblinb Goblinb commented Jul 2, 2018

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):

uenwv

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.