Some odd reaction with PyQt5.8 on windows 10. I'm making this because I want to try to understand why I get this problem, as it's easily solved. (Shown below)
I try to do:
Command =''' testurl -x --audio-format "mp3" --audio-quality "0"'''
self.start('yotube-dl',Command.split())
but get the error from youtube-dl that the specified audio format is wrong. Which means that for some reason, "mp3"
isn't after --audio-format
. I also tried, --audio-format="mp3"
, and that also gives me an error, despite not having a space after the --audio-format
Now, if I do my "workaround":
self.start('youtube-dl'+Command)
It works as expected. It tells you the specified URL(since it's testurl
) is not valid. Don't be mistakes, a working url behaves just the same. So, obviously one would think there's something funky with the .split()
part of it, but this is how the list turns out when you use Command.split()
:
['testurl', '-x', '--audio-format', '"mp3"', '--audio-quality', '"0"']
And as far as I know, the arguments are passed in order of the list. I've had it working before, but as soon as I changed another configuration, it all went south. I just can't figure out why my results differ, and it's only for this specific audio conversion argument(-x --audio-format "mp3"
), other arguments work pretty well, one of them containing spaces.
Also, I can let you know I tried with lots of "
's around in the string, and to no help. I'm presuming this has something to do with the way "
are added in some places on windows according to Qt documentation(Link for reference), but I still can't make figure out what to change. For all I know, it's something stupid i'm doing.
So, if anyone has understanding of why it does this, i'd love to know. Again, i'm just looking for some clarity, as I already worked around it, but want to understand why it goes wrong.