I want to be able to take a shortened or non-shortened URL and return its un-shortened form. How can I make a python program to do this?
Additional Clarification:
Using requests:
import requests session = requests.Session() # so connections are recycled resp = session.head(url, allow_redirects=True) print(resp.url)