def fix_relative(html, url):
    """ this is fucking cheesy """
    try:
        base = '/'.join(url.split('/')[:3])
        html = html.replace("src='//", "src='http://")
        html = html.replace('src="//', 'src="http://')
        html = html.replace("src='/", "src='%s/" % base)
        html = html.replace('src="/', 'src="%s/' % base)
    except Exception as ex:
        pass
    return html
