Using Python and 3 aiohttp to find the URL after redirect when timeout
<p>I'm currently trying to audit a large number of redirect URL handles to make sure that their destinations are still valid. </p>

<p>I'm using aiohttp to go through the large volume in order to produce a report. </p>

<pre><code>try:
    with aiohttp.Timeout(timeout):
        async with session.get(url) as resp:
            return {"Handle URL": url,
                    "Status Code": resp.status,
                    "Redirects": resp.url != url,
                    "Resolving URL": resp.url,
                    "Success": resp.status == 200,
                    "Message": ""}
except asyncio.TimeoutError:
        return {"Handle URL": url,
                "Success": False,
                "Message": "Handle server timed out. &gt;{} seconds".format(timeout)}
</code></pre>

<p>For the most part, this has been fine for identifying which URL redirect no longer sends to a valid URL. However, I'd really like to know the final address where times out.</p>

<p>Any ideas?</p>