def get_shortened_url(long_url):
    r = requests.post('https://hideuri.com/api/v1/shorten', data={'url': long_url.replace(' ', '%20')})
    try:
        r.raise_for_status()
        return r.json()['result_url']
    except requests.exceptions.HTTPError as e:
        return long_url
def get_shortened_url(long_url):
    r = requests.post('https://hideuri.com/api/v1/shorten', data={'url': long_url.replace(' ', '%20')})
    try:
        r.raise_for_status()
        return r.json()['result_url']
    except requests.exceptions.HTTPError as e:
        return long_url