How to use progressbar module with urlretrieve
<p>My <strong>pyhton3</strong> script downloads a number of images over the internet using <strong>urlretrieve</strong>, and I'd like to add a progressbar with a <em>completed percentage</em> and <em>download speed</em> for each download. </p>

<p>The <a href="http://progressbar-2.readthedocs.io/en/latest/" rel="noreferrer">progressbar</a> module seems like a good solution, but although I've looked through <a href="http://progressbar-2.readthedocs.io/en/latest/examples.html" rel="noreferrer">their examples</a>, and <em>example4</em> seems like the right thing, I still can't understand how to wrap it around the <em>urlretrieve</em>.</p>

<p>I guess I should add a third parameter:</p>

<pre><code>urllib.request.urlretrieve('img_url', 'img_filename', some_progressbar_based_reporthook)
</code></pre>

<p>But how do I properly define it?</p>