title: Custom User-Agent in youtube-dl python script
body: <p>I have the following piece of python code which calls youtube-dl and extracts the links that I need.</p>
  
  <pre><code>ydl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s%(ext)s'})
  
  with ydl:
      result = ydl.extract_info(
          url,
          download=False
           # We just want to extract the info
      )
  
  if 'entries' in result:
      # Can be a playlist or a list of videos
      video = result['entries'][0]
  else:
      # Just a video
      video = result
  
  if video:
      return video
  
  return None
  </code></pre>
  
  <p>But I want to use the custom User-Agent in this program. I know I can specify the custom User-Agent while using the youtube-dl in the command line.</p>
  
  <p>Is there any way I can specify the custom user-agent in the program embedding youtube-dl.</p>
  
  <p>Thanks </p>