Bugging shortcuts with python

0

I need for my project, some function using Python 2.7 to enter a URL, and get the next URL from it. - > Example: goo.gl/LAKFXG = link bit.ly/2D3SEnZ = link

I do not want to use the API of these URLs, but something that actually enters the url and returns me the final URL. But I'm out of ideas. Any library? Remembering that I do not want to use the shortcuts APIs.

    
asked by anonymous 19.12.2017 / 16:48

1 answer

4
import urllib2
r = urllib2.urlopen(url="https://shorturl.com")
print 'URL redirecionada:', r.url
    
19.12.2017 / 19:18