1

Im trying to figure out how to use youtube-dl using a python script, I want to download mp3 only & can't figure out how to use "postprocessor_args" option. Does it take a string or a dict of options & what options are available ?

I tried reading the source code but could not find where or how the "postprocessor_args" is to be used

import youtube_dl
options = {'outtmpl': '%(id)s%(ext)s'
'postprocessor_args': "What to add here? dict or string?"
}
ydl = youtube_dl.YoutubeDL(options)
with ydl:
    result = ydl.extract_info(
    'http://www.youtube.com/watch?v=xxxxxx',
    download=False # We just want to extract the info
)
MichaelHabib
  • 158
  • 7
  • Just do a little research and you get what you want. – user1767754 Nov 27 '17 at 07:29
  • the recommended link requires selecting the postprocessor , I'm trying to just pass in the output format & let youtube-dl select which postprocessor to use. The "postprocessor_args" option shown in youtube-dl/__init__.py is what i'm trying to use https://github.com/rg3/youtube-dl/blob/master/youtube_dl/__init__.py#L421 – MichaelHabib Nov 27 '17 at 07:37
  • Ok, to clarify. you are not `selecting` the postprocessor you are just `preferring` there is no guarantee that you will get them. If you don't want it at all, you can just skip those options as well. – user1767754 Nov 27 '17 at 07:39

0 Answers0