コード例 #1
0
    def run(self):
        self.started = True

        show_object = find_show(self.series_id, self.series_provider_id)
        if not show_object:
            return

        episode_object = show_object.get_episode(self.season, self.episode)

        try:
            sickrage.app.log.info(
                "Starting backlog search for: [{}] S{:02d}E{:02d}".format(
                    show_object.name, self.season, self.episode))

            WebSocketMessage(
                'SEARCH_QUEUE_STATUS_UPDATED', {
                    'seriesSlug': show_object.slug,
                    'episodeId': episode_object.episode_id,
                    'searchQueueStatus': episode_object.search_queue_status
                }).push()

            search_result = search_providers(self.series_id,
                                             self.series_provider_id,
                                             self.season,
                                             self.episode,
                                             manualSearch=False)

            if search_result:
                snatch = all([(search_result.series_id, search_result.season,
                               episode)
                              not in sickrage.app.search_queue.SNATCH_HISTORY
                              for episode in search_result.episodes])

                if snatch:
                    [
                        sickrage.app.search_queue.SNATCH_HISTORY.append(
                            (search_result.series_id, search_result.season,
                             episode)) for episode in search_result.episodes
                    ]

                    sickrage.app.log.info("Downloading {} from {}".format(
                        search_result.name, search_result.provider.name))
                    snatch_episode(search_result)
            else:
                sickrage.app.log.info(
                    "Unable to find search results for: [{}] S{:02d}E{:02d}".
                    format(show_object.name, self.season, self.episode))
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            WebSocketMessage(
                'SEARCH_QUEUE_STATUS_UPDATED', {
                    'seriesSlug': show_object.slug,
                    'episodeId': episode_object.episode_id,
                    'searchQueueStatus': episode_object.search_queue_status
                }).push()

            sickrage.app.log.info(
                "Finished backlog search for: [{}] S{:02d}E{:02d}".format(
                    show_object.name, self.season, self.episode))
コード例 #2
0
    def run(self):
        self.started = True

        show_object = find_show(self.series_id, self.series_provider_id)
        if not show_object:
            return

        episode_object = show_object.get_episode(self.season, self.episode)

        try:
            sickrage.app.log.info("Starting daily search for: [" +
                                  show_object.name + "]")

            WebSocketMessage(
                'SEARCH_QUEUE_STATUS_UPDATED', {
                    'seriesSlug': show_object.slug,
                    'episodeId': episode_object.episode_id,
                    'searchQueueStatus': episode_object.search_queue_status
                }).push()

            search_result = search_providers(
                self.series_id,
                self.series_provider_id,
                self.season,
                self.episode,
                cacheOnly=sickrage.app.config.general.enable_rss_cache)

            if search_result:
                snatch = all([(search_result.series_id, search_result.season,
                               episode)
                              not in sickrage.app.search_queue.SNATCH_HISTORY
                              for episode in search_result.episodes])

                if snatch:
                    [
                        sickrage.app.search_queue.SNATCH_HISTORY.append(
                            (search_result.series_id, search_result.season,
                             episode)) for episode in search_result.episodes
                    ]

                    sickrage.app.log.info("Downloading " + search_result.name +
                                          " from " +
                                          search_result.provider.name)
                    snatch_episode(search_result)
            else:
                sickrage.app.log.info("Unable to find search results for: [" +
                                      show_object.name + "]")
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            WebSocketMessage(
                'SEARCH_QUEUE_STATUS_UPDATED', {
                    'seriesSlug': show_object.slug,
                    'episodeId': episode_object.episode_id,
                    'searchQueueStatus': episode_object.search_queue_status
                }).push()

            sickrage.app.log.info("Finished daily search for: [" +
                                  show_object.name + "]")
コード例 #3
0
ファイル: search.py プロジェクト: Entro-pie/SiCKRAGE
    def run(self):
        self.started = True

        show_object = find_show(self.show_id)
        episode_object = show_object.get_episode(self.season, self.episode)

        try:
            sickrage.app.log.info("Starting failed download search for: [" +
                                  episode_object.name + "]")

            sickrage.app.log.info("Marking episode as bad: [" +
                                  episode_object.pretty_name() + "]")

            FailedHistory.mark_failed(self.show_id, self.season, self.episode)

            (release, provider) = FailedHistory.find_failed_release(
                self.show_id, self.season, self.episode)
            if release:
                FailedHistory.log_failed(release)
                History.log_failed(self.show_id, self.season, self.episode,
                                   release, provider)

            FailedHistory.revert_failed_episode(self.show_id, self.season,
                                                self.episode)

            search_result = search_providers(self.show_id,
                                             self.season,
                                             self.episode,
                                             manualSearch=True,
                                             downCurQuality=False)
            if search_result:
                snatch = all([(search_result.show_id, search_result.season,
                               episode)
                              not in sickrage.app.search_queue.SNATCH_HISTORY
                              for episode in search_result.episodes])

                if snatch:
                    [
                        sickrage.app.search_queue.fifo(
                            sickrage.app.search_queue.SNATCH_HISTORY,
                            (search_result.show_id, search_result.season,
                             episode),
                            sickrage.app.search_queue.SNATCH_HISTORY_SIZE)
                        for episode in search_result.episodes
                    ]

                    sickrage.app.log.info("Downloading " + search_result.name +
                                          " from " +
                                          search_result.provider.name)
                    snatch_episode(search_result)
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            sickrage.app.log.info("Finished failed download search for: [" +
                                  show_object.name + "]")
            sickrage.app.search_queue.fifo(
                sickrage.app.search_queue.MANUAL_SEARCH_HISTORY, self,
                sickrage.app.search_queue.MANUAL_SEARCH_HISTORY_SIZE)
コード例 #4
0
ファイル: search.py プロジェクト: Entro-pie/SiCKRAGE
    def run(self):
        self.started = True

        show_object = find_show(self.show_id)
        episode_object = show_object.get_episode(self.season, self.episode)

        try:
            sickrage.app.log.info("Starting manual search for: [" +
                                  episode_object.pretty_name() + "]")

            search_result = search_providers(
                self.show_id,
                self.season,
                self.episode,
                manualSearch=True,
                downCurQuality=self.downCurQuality)
            if search_result:
                [
                    sickrage.app.search_queue.fifo(
                        sickrage.app.search_queue.SNATCH_HISTORY,
                        (search_result.show_id, search_result.season, episode),
                        sickrage.app.search_queue.SNATCH_HISTORY_SIZE)
                    for episode in search_result.episodes
                ]

                sickrage.app.log.info("Downloading " + search_result.name +
                                      " from " + search_result.provider.name)
                self.success = snatch_episode(search_result)
            else:
                sickrage.app.alerts.message(
                    _('No downloads were found'),
                    _("Couldn't find a download for <i>%s</i>") %
                    episode_object.pretty_name())

                sickrage.app.log.info("Unable to find a download for: [" +
                                      episode_object.pretty_name() + "]")
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            sickrage.app.log.info("Finished manual search for: [" +
                                  episode_object.pretty_name() + "]")
            sickrage.app.search_queue.fifo(
                sickrage.app.search_queue.MANUAL_SEARCH_HISTORY, self,
                sickrage.app.search_queue.MANUAL_SEARCH_HISTORY_SIZE)
コード例 #5
0
ファイル: search.py プロジェクト: Entro-pie/SiCKRAGE
    def run(self):
        self.started = True

        show_obj = find_show(self.show_id)

        try:
            sickrage.app.log.info("Starting daily search for: [" +
                                  show_obj.name + "]")

            search_result = search_providers(
                self.show_id,
                self.season,
                self.episode,
                cacheOnly=sickrage.app.config.enable_rss_cache)
            if search_result:
                snatch = all([(search_result.show_id, search_result.season,
                               episode)
                              not in sickrage.app.search_queue.SNATCH_HISTORY
                              for episode in search_result.episodes])

                if snatch:
                    [
                        sickrage.app.search_queue.fifo(
                            sickrage.app.search_queue.SNATCH_HISTORY,
                            (search_result.show_id, search_result.season,
                             episode),
                            sickrage.app.search_queue.SNATCH_HISTORY_SIZE)
                        for episode in search_result.episodes
                    ]

                    sickrage.app.log.info("Downloading " + search_result.name +
                                          " from " +
                                          search_result.provider.name)
                    snatch_episode(search_result)
            else:
                sickrage.app.log.info("Unable to find search results for: [" +
                                      show_obj.name + "]")
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            sickrage.app.log.info("Finished daily search for: [" +
                                  show_obj.name + "]")
コード例 #6
0
ファイル: search.py プロジェクト: newrain7803/SiCKRAGE
    def run(self):
        self.started = True

        show_object = find_show(self.show_id)
        if not show_object:
            return

        try:
            sickrage.app.log.info(
                "Starting backlog search for: [{}] S{:02d}E{:02d}".format(
                    show_object.name, self.season, self.episode))

            search_result = search_providers(self.show_id,
                                             self.season,
                                             self.episode,
                                             manualSearch=False)
            if search_result:
                snatch = all([(search_result.show_id, search_result.season,
                               episode)
                              not in sickrage.app.search_queue.SNATCH_HISTORY
                              for episode in search_result.episodes])

                if snatch:
                    [
                        sickrage.app.search_queue.SNATCH_HISTORY.append(
                            (search_result.show_id, search_result.season,
                             episode)) for episode in search_result.episodes
                    ]

                    sickrage.app.log.info("Downloading {} from {}".format(
                        search_result.name, search_result.provider.name))
                    snatch_episode(search_result)
            else:
                sickrage.app.log.info(
                    "Unable to find search results for: [{}] S{:02d}E{:02d}".
                    format(show_object.name, self.season, self.episode))
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            sickrage.app.log.info(
                "Finished backlog search for: [{}] S{:02d}E{:02d}".format(
                    show_object.name, self.season, self.episode))
コード例 #7
0
ファイル: search.py プロジェクト: yinghuodt007/SiCKRAGE
    def run(self, session=None):
        self.started = True

        show_object = find_show(self.show_id, session=session)

        try:
            sickrage.app.log.info("Starting backlog search for: [" +
                                  show_object.name + "]")

            search_result = search_providers(self.show_id,
                                             self.season,
                                             self.episode,
                                             manualSearch=False)
            if search_result:
                for episode in search_result.episodes:
                    if (search_result.show_id, search_result.season, episode
                        ) in sickrage.app.search_queue.SNATCH_HISTORY:
                        raise StopIteration

                    sickrage.app.search_queue.fifo(
                        sickrage.app.search_queue.SNATCH_HISTORY,
                        (search_result.show_id, search_result.season, episode),
                        sickrage.app.search_queue.SNATCH_HISTORY_SIZE)

                sickrage.app.log.info("Downloading " + search_result.name +
                                      " from " + search_result.provider.name)
                snatch_episode(search_result)
            else:
                sickrage.app.log.info("Unable to find search results for: [" +
                                      show_object.name + "]")
        except StopIteration:
            pass
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            sickrage.app.log.info("Finished backlog search for: [" +
                                  show_object.name + "]")
コード例 #8
0
    def run(self):
        self.started = True

        sickrage.app.search_queue.TASK_HISTORY[self.id] = {
            'season': self.season,
            'episode': self.episode
        }

        show_object = find_show(self.series_id, self.series_provider_id)
        if not show_object:
            return

        episode_object = show_object.get_episode(self.season, self.episode)

        try:
            sickrage.app.log.info("Starting failed download search for: [" +
                                  episode_object.name + "]")

            WebSocketMessage(
                'SEARCH_QUEUE_STATUS_UPDATED', {
                    'seriesSlug': show_object.slug,
                    'episodeId': episode_object.episode_id,
                    'searchQueueStatus': episode_object.search_queue_status
                }).push()

            sickrage.app.log.info("Marking episode as bad: [" +
                                  episode_object.pretty_name() + "]")

            FailedHistory.mark_failed(self.series_id, self.series_provider_id,
                                      self.season, self.episode)

            (release, provider) = FailedHistory.find_failed_release(
                self.series_id, self.series_provider_id, self.season,
                self.episode)
            if release:
                FailedHistory.log_failed(release)
                History.log_failed(self.series_id, self.series_provider_id,
                                   self.season, self.episode, release,
                                   provider)

            FailedHistory.revert_failed_episode(self.series_id,
                                                self.series_provider_id,
                                                self.season, self.episode)

            search_result = search_providers(self.series_id,
                                             self.series_provider_id,
                                             self.season,
                                             self.episode,
                                             manualSearch=True,
                                             downCurQuality=False)

            if search_result:
                snatch = all([(search_result.series_id, search_result.season,
                               episode)
                              not in sickrage.app.search_queue.SNATCH_HISTORY
                              for episode in search_result.episodes])

                if snatch:
                    [
                        sickrage.app.search_queue.SNATCH_HISTORY.append(
                            (search_result.series_id, search_result.season,
                             episode)) for episode in search_result.episodes
                    ]

                    sickrage.app.log.info("Downloading " + search_result.name +
                                          " from " +
                                          search_result.provider.name)
                    snatch_episode(search_result)
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            WebSocketMessage(
                'SEARCH_QUEUE_STATUS_UPDATED', {
                    'seriesSlug': show_object.slug,
                    'episodeId': episode_object.episode_id,
                    'searchQueueStatus': episode_object.search_queue_status
                }).push()

            sickrage.app.log.info("Finished failed download search for: [" +
                                  show_object.name + "]")
コード例 #9
0
    def run(self):
        self.started = True

        sickrage.app.search_queue.TASK_HISTORY[self.id] = {
            'season': self.season,
            'episode': self.episode
        }

        show_object = find_show(self.series_id, self.series_provider_id)
        if not show_object:
            return

        episode_object = show_object.get_episode(self.season, self.episode)

        WebSocketMessage(
            'SEARCH_QUEUE_STATUS_UPDATED', {
                'seriesSlug': show_object.slug,
                'episodeId': episode_object.episode_id,
                'searchQueueStatus': episode_object.search_queue_status
            }).push()

        try:
            sickrage.app.log.info("Starting manual search for: [" +
                                  episode_object.pretty_name() + "]")

            search_result = search_providers(
                self.series_id,
                self.series_provider_id,
                self.season,
                self.episode,
                manualSearch=True,
                downCurQuality=self.downCurQuality)

            if search_result:
                [
                    sickrage.app.search_queue.SNATCH_HISTORY.append(
                        (search_result.series_id, search_result.season,
                         episode)) for episode in search_result.episodes
                ]

                sickrage.app.log.info("Downloading " + search_result.name +
                                      " from " + search_result.provider.name)
                self.success = snatch_episode(search_result)

                WebSocketMessage(
                    'EPISODE_UPDATED', {
                        'seriesSlug': show_object.slug,
                        'episodeId': episode_object.episode_id,
                        'episode': episode_object.to_json()
                    }).push()
            else:
                sickrage.app.alerts.message(
                    _('No downloads were found'),
                    _("Couldn't find a download for <i>%s</i>") %
                    episode_object.pretty_name())

                sickrage.app.log.info("Unable to find a download for: [" +
                                      episode_object.pretty_name() + "]")
        except Exception:
            sickrage.app.log.debug(traceback.format_exc())
        finally:
            sickrage.app.log.info("Finished manual search for: [" +
                                  episode_object.pretty_name() + "]")