Пример #1
0
    def __get_resolvers(self, include_disabled, include_universal):
        if include_universal is None:
            include_universal = common.get_setting('allow_universal') == "true"

        klasses = urlresolver.relevant_resolvers(self._domain, include_universal=include_universal,
                                                 include_external=True, include_disabled=include_disabled, order_matters=True)
        resolvers = []
        for klass in klasses:
            if klass in resolver_cache:
                common.log_utils.log_debug('adding resolver from cache: %s' % (klass))
                resolvers.append(resolver_cache[klass])
            else:
                common.log_utils.log_debug('adding resolver to cache: %s' % (klass))
                resolver_cache[klass] = klass()
                resolvers.append(resolver_cache[klass])
        return resolvers
Пример #2
0
    def __get_resolvers(self, include_disabled, include_universal):
        if include_universal is None:
            include_universal = common.get_setting('allow_universal') == "true"

        klasses = urlresolver.relevant_resolvers(self._domain, include_universal=include_universal,
                                                 include_external=True, include_disabled=include_disabled, order_matters=True)
        resolvers = []
        for klass in klasses:
            if klass in resolver_cache:
                common.log_utils.log_debug('adding resolver from cache: %s' % (klass))
                resolvers.append(resolver_cache[klass])
            else:
                common.log_utils.log_debug('adding resolver to cache: %s' % (klass))
                resolver_cache[klass] = klass()
                resolvers.append(resolver_cache[klass])
        # sort resolvers
        resolvers.sort(key=lambda r: r.get_priority, reverse=True)
        return resolvers
Пример #3
0
    def sourcesDictionary(self):
        hosts = resolvers.info()
        hosts = [i for i in hosts if 'host' in i]

        self.rdDict = []
        self.pzDict = []
        #self.rdDict = realdebrid.getHosts()
        #self.pzDict = premiumize.getHosts()

        self.hostlocDict = [
            i['netloc'] for i in hosts
            if i['quality'] == 'High' and i['captcha'] == False
        ]
        try:
            self.hostlocDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hostlocDict)
            ]
        except:
            pass
        self.hostlocDict = [
            x for y, x in enumerate(self.hostlocDict)
            if x not in self.hostlocDict[:y]
        ]

        self.hostdirhdDict = [
            i['netloc'] for i in resolvers.info()
            if 'quality' in i and i['quality'] == 'High' and 'captcha' in i
            and i['captcha'] == False and 'a/c' in i and i['a/c'] == False
        ]
        try:
            self.hostdirhdDict = [
                i.lower().rsplit('.', 1)[0]
                for i in reduce(lambda x, y: x + y, self.hostdirhdDict)
            ]
        except:
            pass
        self.hostdirhdDict = [
            x for y, x in enumerate(self.hostdirhdDict)
            if x not in self.hostdirhdDict[:y]
        ]

        self.hostprDict = [i['host'] for i in hosts if i['a/c'] == True]
        try:
            self.hostprDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hostprDict)
            ]
        except:
            pass
        self.hostprDict = [
            x for y, x in enumerate(self.hostprDict)
            if x not in self.hostprDict[:y]
        ]

        self.hostcapDict = [i['host'] for i in hosts if i['captcha'] == True]
        try:
            self.hostcapDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hostcapDict)
            ]
        except:
            pass
        self.hostcapDict = [
            i for i in self.hostcapDict if not i in self.rdDict + self.pzDict
        ]

        self.hosthdDict = [
            i['host'] for i in hosts if i['quality'] == 'High'
            and i['a/c'] == False and i['captcha'] == False
        ]
        self.hosthdDict += [
            i['host'] for i in hosts if i['quality'] == 'High'
            and i['a/c'] == False and i['captcha'] == True
        ]
        try:
            self.hosthdDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hosthdDict)
            ]
        except:
            pass

        self.hosthqDict = [
            i['host'] for i in hosts if i['quality'] == 'High'
            and i['a/c'] == False and i['captcha'] == False
        ]
        try:
            self.hosthqDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hosthqDict)
            ]
        except:
            pass

        self.hostmqDict = [
            i['host'] for i in hosts if i['quality'] == 'Medium'
            and i['a/c'] == False and i['captcha'] == False
        ]
        try:
            self.hostmqDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hostmqDict)
            ]
        except:
            pass

        self.hostlqDict = [
            i['host'] for i in hosts if i['quality'] == 'Low'
            and i['a/c'] == False and i['captcha'] == False
        ]
        try:
            self.hostlqDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hostlqDict)
            ]
        except:
            pass

        try:
            self.hostDict = urlresolver.relevant_resolvers(order_matters=True)
            self.hostDict = [
                i.domains for i in self.hostDict if not '*' in i.domains
            ]
            self.hostDict = [
                i.lower() for i in reduce(lambda x, y: x + y, self.hostDict)
            ]
            self.hostDict = [
                x for y, x in enumerate(self.hostDict)
                if x not in self.hostDict[:y]
            ]

        except:
            self.hostDict = []

        #for i in self.hostDict:
        #	control.log('##### SOURCES DICTY: %s' % i )

        self.hostsdfullDict = self.hostprDict + self.hosthqDict + self.hostmqDict + self.hostlqDict + self.hostDict
        #for i in self.hostsdfullDict:
        #	control.log('##### SOURCES DICTY2: %s' % i )
        #self.hostsdfullDict = self.hostDict

        self.hosthdfullDict = self.hostprDict + self.hosthdDict
Пример #4
0
    def sourcesDictionary(self):
        hosts = resolvers.info()
        hosts = [i for i in hosts if 'host' in i]

        self.rdDict = realdebrid.getHosts()
        self.pzDict = premiumize.getHosts()

        self.hostlocDict = [i['netloc'] for i in hosts if i['quality'] == 'High' and i['captcha'] == False]
        try: self.hostlocDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostlocDict)]
        except: pass
        self.hostlocDict = [x for y,x in enumerate(self.hostlocDict) if x not in self.hostlocDict[:y]]

        self.hostdirhdDict = [i['netloc'] for i in resolvers.info() if 'quality' in i and i['quality'] == 'High' and 'captcha' in i and i['captcha'] == False and 'a/c' in i and i['a/c'] == False]
        try: self.hostdirhdDict = [i.lower().rsplit('.', 1)[0] for i in reduce(lambda x, y: x+y, self.hostdirhdDict)]
        except: pass
        self.hostdirhdDict = [x for y,x in enumerate(self.hostdirhdDict) if x not in self.hostdirhdDict[:y]]

        self.hostprDict = [i['host'] for i in hosts if i['a/c'] == True]
        try: self.hostprDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostprDict)]
        except: pass
        self.hostprDict = [x for y,x in enumerate(self.hostprDict) if x not in self.hostprDict[:y]]

        self.hostcapDict = [i['host'] for i in hosts if i['captcha'] == True]
        try: self.hostcapDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostcapDict)]
        except: pass
        self.hostcapDict = [i for i in self.hostcapDict if not i in self.rdDict + self.pzDict]

        self.hosthdDict = [i['host'] for i in hosts if i['quality'] == 'High' and i['a/c'] == False and i['captcha'] == False]
        self.hosthdDict += [i['host'] for i in hosts if i['quality'] == 'High' and i['a/c'] == False and i['captcha'] == True]
        try: self.hosthdDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hosthdDict)]
        except: pass

        self.hosthqDict = [i['host'] for i in hosts if i['quality'] == 'High' and i['a/c'] == False and i['captcha'] == False]
        try: self.hosthqDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hosthqDict)]
        except: pass

        self.hostmqDict = [i['host'] for i in hosts if i['quality'] == 'Medium' and i['a/c'] == False and i['captcha'] == False]
        try: self.hostmqDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostmqDict)]
        except: pass

        self.hostlqDict = [i['host'] for i in hosts if i['quality'] == 'Low' and i['a/c'] == False and i['captcha'] == False]
        try: self.hostlqDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostlqDict)]
        except: pass

        try:
            self.hostDict = urlresolver.relevant_resolvers(order_matters=True)
            self.hostDict = [i.domains for i in self.hostDict if not '*' in i.domains]
            self.hostDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostDict)]
            self.hostDict = [x for y,x in enumerate(self.hostDict) if x not in self.hostDict[:y]]

        except:
            self.hostDict = []

        #for i in self.hostDict:
        #    control.log('##### SOURCES DICTY: %s' % i )

        self.hostsdfullDict = self.hostprDict + self.hosthqDict + self.hostmqDict + self.hostlqDict + self.hostDict
        #for i in self.hostsdfullDict:
        #    control.log('##### SOURCES DICTY2: %s' % i )
        #self.hostsdfullDict = self.hostDict

        self.hosthdfullDict = self.hostprDict + self.hosthdDict