title: How to get the download percentage and speed of a download using Paffy?
body: <p>I have written a small python program to download videos from youtube. The function takes a URL as input and then downloads it.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>def download(i):
      global path
      global c
      global threads
      try:
          fh1 = open(path + "done.txt","a") 
          fh = open(path +"err.txt", "a")
          video = pafy.new(i)
          name = str(c) + '. ' + video.title
          c += 1
          try:
              for p in ('|', '?', '\\', '/', ':', '*', '&lt;', '&gt;', '\"'):
                   name = name.replace(p, '_')
  
              best = video.getbest(preftype="mp4")
              print("Downloading "+name+"...")
              best.download(quiet=False, filepath= path + name + '.' + best.extension)
              print("Done Downloading "+name)
              fh1.write("Done : " +name+ '\n')
              fh1.close()
  </code></pre>
  
  <p><code>best.download(quiet=False, filepath= path + name + '.' + best.extension)</code> line is showing the download percentage speed time left and some other stuff but I cannot find a proper way to get the data that is being shown there. I want to store the data in some variable so that I can show the data in some other place or write it in some file.</p>