Created
August 14, 2013 03:34
Revisions
-
tylerdave created this gist
Aug 14, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import requests def _resolve_redirected_url(url): response = requests.get(url, allow_redirects=False) if response.status_code in [301, 302, 307, 308] and 'location' in response.headers: url = response.headers['location'] return url