

def request(url):
    try:
        if ('</regex>' in url):
            import regex
            url = regex.resolve(url)
        rd = realdebrid.resolve(url)
        if (not (rd == None)):
            return rd
        pz = premiumize.resolve(url)
        if (not (pz == None)):
            return pz
        if url.startswith('rtmp'):
            if (len(re.compile('\\s*timeout=(\\d*)').findall(url)) == 0):
                url += ' timeout=10'
            return url
        u = client.shrink_host(url)
        u = u.lower()
        r = [i['class'] for i in info() if (u in i['netloc'])][0]
        r = __import__(r, globals(), locals(), [], (- 1))
        r = r.resolve(url)
        if (r == None):
            return r
        elif (type(r) == list):
            return r
        try:
            h = dict(urlparse.parse_qsl(r.rsplit('|', 1)[1]))
        except:
            h = dict('')
        if (not ('User-Agent' in h)):
            h['User-Agent'] = client.agent()
        if (not ('Referer' in h)):
            h['Referer'] = url
        r = ('%s|%s' % (r.split('|')[0], urllib.urlencode(h)))
        return r
    except:
        return url

dataset/ETHPy150Open mrknow/filmkodi/plugin.video.specto/resources/lib/resolvers/__init__.py request/original