Beispiel #1
0
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 = urlparse.urlparse(url).netloc
        u = u.replace('www.', '').replace('embed.', '')
        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
        elif not r.startswith('http'): return r

        try: h = dict(urlparse.parse_qsl(r.rsplit('|', 1)[1]))
        except: h = dict('')
        h.update({'Referer': url, 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0'})

        r = '%s|%s' % (r.split('|')[0], urllib.urlencode(h))
        return r
    except:
        return url
Beispiel #2
0
def request(url):
    try:
        #control.log("#RESOLVER#  my url 1 ************ %s " % url)

        if '</regex>' in url:
            import regex ; url = regex.resolve(url)

        rd = realdebrid.resolve(url)
        #control.log("#RESOLVER#  my rd 2 ************ %s url: %s" % (rd,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 = urlparse.urlparse(url).netloc
        u = u.replace('www.', '').replace('embed.', '')
        u = u.lower()

        #control.log("#RESOLVER#  URL TO MATCH url 3 ************ %s " % u)

        r = [i['class'] for i in info() if u in i['netloc']][0]
        r = __import__(r, globals(), locals(), [], -1)
        #control.log("#RESOLVER#  my url 4 ************ %s " % r)

        r = r.resolve(url)
        #control.log("#RESOLVER#  my url 5 %s ************ %s " % (r,url))

        if r == None: return r

        elif type(r) == list: return r
        #elif not r.startswith('http'): 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))
        #control.log("#RESOLVER#  my url 6 %s ************ %s " % (r,url))

        return r
    except:
        return url
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 = urlparse.urlparse(url).netloc
        u = u.replace('www.', '').replace('embed.', '').replace('config.','')
        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:
            import urlresolver
            r = urlresolver.resolve(url)
            if not r:
                r = None

        if r == None: return r
        elif type(r) == list: return r
        elif not r.startswith('http'): 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:
        try :
            import urlresolver
            r = urlresolver.resolve(url)
            if not r :
                url = r
        except:
            pass
        return url
Beispiel #4
0
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 = urlparse.urlparse(url).netloc
        u = u.replace("www.", "").replace("embed.", "")
        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
        elif not r.startswith("http"):
            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
Beispiel #5
0
def request(url):
    try:
        control.log("#RESOLVER#  my url 1 ************ %s " % url)

        if '</regex>' in url:
            import regex ; url = regex.resolve(url)

        #rd = realdebrid.resolve(url)
        #if not rd == None: return rd
        rd= None
        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 = urlparse.urlparse(url)[1].split('.')
        u = u[-2] + '.' + u[-1]
        control.log("#RESOLVER#  my url 2 ************ %s " % u)
        u = u.lower()

        control.log("#RESOLVER#  my url 3 ************ %s " % u)

        r = [i['class'] for i in info() if u in i['netloc']][0]
        r = __import__(r, globals(), locals(), [], -1)
        control.log("#RESOLVER#  my url 4 ************ %s " % r)

        r = r.resolve(url)
        control.log("#RESOLVER#  my url 5 ************ %s " % r)

        if r == None: return r
        elif type(r) == list: return r
        elif not r.startswith('http'): 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
Beispiel #6
0
def request(url):
    try:
        control.log("#RESOLVER#  my url 1 ************ %s " % url)

        if '</regex>' in url:
            import regex
            url = regex.resolve(url)

        rd = realdebrid.resolve(url)
        #control.log("#RESOLVER#  my rd 2 ************ %s url: %s" % (rd,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

        try:
            z = False
            hmf = urlresolver.HostedMediaFile(url,
                                              include_disabled=False,
                                              include_universal=False)
            if hmf:
                print 'yay! we can resolve this one'
                z = hmf.resolve()
            else:
                print 'sorry :( no resolvers available to handle this one.'

            control.log("!!!!!!!!! OK #urlresolver2#  URL %s " % z)

            if z != False: return z
        except Exception as e:
            control.log("!!!!!!!!! ERROR #urlresolver2#  URL %s " % e)
            pass
        return None
    except:
        return url
Beispiel #7
0
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 = urlparse.urlparse(url).netloc
        u = u.replace('www.', '').replace('embed.', '')
        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
        elif not r.startswith('http'): 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
Beispiel #8
0
def request(url):
    try:
        control.log("#RESOLVER#  my url 1 ************ %s " % url)

        if '</regex>' in url:
            import regex ; url = regex.resolve(url)

        rd = realdebrid.resolve(url)
        #control.log("#RESOLVER#  my rd 2 ************ %s url: %s" % (rd,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

        try:
            z=False
            hmf = urlresolver.HostedMediaFile(url,include_disabled=True, include_universal=False)
            if hmf:
                print 'yay! we can resolve this one'
                z = hmf.resolve()
            else:
                print 'sorry :( no resolvers available to handle this one.'

            control.log("!!!!!!!!! OK #urlresolver2#  URL %s " % z)

            if z !=False : return z
        except Exception as e:
            control.log("!!!!!!!!! ERROR #urlresolver2#  URL %s " % e)
            pass
        return None
    except:
        return url
Beispiel #9
0
def request(url):
    try:
        #control.log("#RESOLVER#  my url 1 ************ %s " % url)

        if '</regex>' in url:
            import regex
            url = regex.resolve(url)

        rd = realdebrid.resolve(url)
        #control.log("#RESOLVER#  my rd 2 ************ %s url: %s" % (rd,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

        try:
            z = False
            hmf = urlresolver.HostedMediaFile(url,
                                              include_disabled=True,
                                              include_universal=False)
            if hmf:
                print 'yay! we can resolve this one'
                z = hmf.resolve()
            else:
                print 'sorry :( no resolvers available to handle this one.'

            control.log("!!!!!!!!! OK #urlresolver#  URL %s " % z)

            if z != False: return z
        except Exception as e:
            control.log("!!!!!!!!! ERRR #urlresolver#  URL %s " % url)
            pass

        #u = client.shrink_host(url)
        u = urlparse.urlparse(url).netloc
        u = u.replace('www.', '').replace('embed.', '')
        u = u.lower()

        #control.log("#RESOLVER#  URL TO MATCH url 3 ************ %s " % u)

        r = [i['class'] for i in info() if u in i['netloc']][0]
        r = __import__(r, globals(), locals(), [], -1)
        #control.log("#RESOLVER#  my url 4 ************ %s " % r)

        r = r.resolve(url)
        #control.log("#RESOLVER#  my url 5 %s ************ %s " % (r,url))

        if r == None: return r

        elif type(r) == list: return r
        #elif not r.startswith('http'): 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))
        #control.log("#RESOLVER#  my url 6 %s ************ %s " % (r,url))

        return r
    except:
        return url
Beispiel #10
0
def request(url):
    try:
        url =url.replace(" ", "")
        control.log("#RESOLVER#  my url 1 ************ %s " % url)

        if '</regex>' in url:
            import regex ; url = regex.resolve(url)

        rd = realdebrid.resolve(url)
        control.log("#RESOLVER#  my rd 2 ************ %s url: %s" % (rd,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
        try:
            z=None
            hmf = urlresolver.HostedMediaFile(url,include_disabled=True, include_universal=False)
            if hmf:
                print 'yay! we can resolve this one'
                z = hmf.resolve()
            else:
                print 'sorry :( no resolvers available to handle this one.'

            control.log("!!!!!!!!! OK #urlresolver#  URL %s " % z)

            if z == None or z !=False : return z
        except Exception as e:
            control.log("!!!!!!!!! ERRR #urlresolver#  URL %s " % url)
            pass

        #u = client.shrink_host(url)
        u = urlparse.urlparse(url).netloc
        u = u.replace('www.', '').replace('embed.', '')
        u = u.lower()

        control.log("#RESOLVER#  URL TO MATCH url 3 ************ %s " % u)

        r = [i['class'] for i in info() if u in i['netloc']][0]
        r = __import__(r, globals(), locals(), [], -1)
        control.log("#RESOLVER#  my url 4 ************ %s " % r)

        r = r.resolve(url)
        #control.log("#RESOLVER#  my url 5 %s ************ %s " % (r,url))

        if r == None: return r

        elif type(r) == list: return r
        #elif not r.startswith('http'): 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))
        control.log("#RESOLVER#  my url 6 %s ************ %s " % (r,url))

        return r
    except:
        return url