Ejemplo n.º 1
0
    def get_content(self, session, params, successCB, errorCB):
        log.info('%s get_content - params: %s' % (self, str(params)))
        # add/remove trakt compatibility on every content request
        if self.video_addon.setting_exist('trakt_enabled'):
            if self.video_addon.get_setting('trakt_enabled'):
                if 'trakt' not in self.capabilities:
                    self.capabilities.append('trakt')
            else:
                if 'trakt' in self.capabilities:
                    self.capabilities.remove('trakt')

        self.__clear_list()
        self.content_deferred = defer.Deferred()
        self.content_deferred.addCallback(self._resolve_video_items)
        self.content_deferred.addCallbacks(successCB, errorCB)
        # setting timeout for resolving content
        loading_timeout = int(self.video_addon.get_setting('loading_timeout'))
        if loading_timeout > 0:
            socket.setdefaulttimeout(loading_timeout)

        try:
            ssl._create_default_https_context = ssl._create_unverified_context
        except:
            pass
        thread_task = task.Task(self._get_content_cb, self.run_script, session,
                                params)
        thread_task.run()
        return self.content_deferred
Ejemplo n.º 2
0
    def get_content(self, session, params, successCB, errorCB):
        log.debug('get_content - params:%s' % str(params))
        self.__clear_list()
        self.content_deferred = defer.Deferred()
        self.content_deferred.addCallbacks(successCB, errorCB)
        # setting timeout for resolving content
        loading_timeout = int(self.video_addon.get_setting('loading_timeout'))
        if loading_timeout > 0:
            socket.setdefaulttimeout(loading_timeout)

        thread_task = task.Task(self._get_content_cb, self.run_script, session, params)
        thread_task.run()
        return self.content_deferred
Ejemplo n.º 3
0
    def get_content(self, session, params, successCB, errorCB):
        log.info('%s get_content - params: %s' % (self, str(params)))
        self.__clear_list()
        self.content_deferred = defer.Deferred()
        self.content_deferred.addCallback(self._resolve_video_items)
        self.content_deferred.addCallbacks(successCB, errorCB)
        # setting timeout for resolving content
        loading_timeout = int(self.video_addon.get_setting('loading_timeout'))
        if loading_timeout > 0:
            socket.setdefaulttimeout(loading_timeout)

        try:
            ssl._create_default_https_context = ssl._create_unverified_context
        except:
            pass
        thread_task = task.Task(self._get_content_cb, self.run_script, session,
                                params)
        thread_task.run()
        return self.content_deferred