title: Display Progressbar In Django View When downloading video (youtube-dl)
body: <p>I am calling 'search/' when button is clicked through ajax call. Now my question is i want to show these details <strong>{"file_name":d['filename'],"percentage":d['_percent_str'],"speed":d['_eta_str']}</strong> in a  progress bar while downloading in a web page.</p>
  
  <p>How should i get the json response from video_progress_hook each time it is call by 'progress_hook' parameter in ydl_opts?</p>
  
  <p>I want to get response in javascriprt.</p>
  
  <p>Please help.</p>
  
  <pre><code>def search(request):
  
      file_name=""+str(uuid.uuid1()).split('-')[0]+".mp3"
      query=request.GET.get("query")
      ydl_opts = {
      'format': 'bestaudio/best',
      'postprocessors': [{'key': 'FFmpegExtractAudio',
                         'preferredcodec': 'mp3',
                         'preferredquality': '192'}],
      'outtmpl': 'media/'+file_name,
      'progress_hooks':[video_progress_hook],
      'quiet': False,
      }
      ydl = youtube_dl.YoutubeDL(ydl_opts)
      ydl.download([query])
      args={'url_link':file_name}
      return JsonResponse(args)
  
  def video_progress_hook(d):
      args={}
      if d['status'] == 'downloading':
          args={"file_name":d['filename'],"percentage":d['_percent_str'],"speed":d['_eta_str']}
      return JsonResponse(args)
  </code></pre>