import requests


def get_redirect_url(link):
    """
        Function to retreive which url the link is redirected to.
        e.g. http://www.google.com/news returns http://news.google.com/news/
    """
    response = requests.get(link)
    if response.history:
        if response.url != link:
            return response.url
        else:
            return link