def get_redirected_url(url: str):
    """
    Given a URL, returns the URL it redirects to or the
    original URL in case of no indirection
    """
    import requests

    with requests.Session() as session:
        with session.get(url, stream=True, allow_redirects=True) as response:
            if response.history:
                return response.url
            else:
                return url

    Given a URL, returns the URL it redirects to or the
    original URL in case of no indirection
    
video_miniGPT4/minigpt4/common/utils.py