Simple and clever analyzer, decoder, encoder ... urls on python, using requests
$ pip install safeurl
Easy way to get real url:
from safeurl.core import getRealURL
getRealURL('http://bit.ly/1gaiW96')
# https://www.yandex.ru/
from safeurl.core import getRealURL
getRealURL(['http://bit.ly/1gaiW96', 'http://bit.ly/1gaiW96'])
# ['https://www.yandex.ru/', 'https://www.yandex.ru/']
Аlso you can find broken urls:
from safeurl.core import getRealURL
getRealURL('http://bit.ly.wrong/wrong')
# 'Failed'
from safeurl.core import getRealURL
getRealURL(['http://bit.ly.wrong/wrong', 'http://bit.ly/1gaiW96'])
# ['Failed', 'https://www.yandex.ru/']
# test info