• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sickbeard.indexerApi函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sickbeard.indexerApi函数的典型用法代码示例。如果您正苦于以下问题:Python indexerApi函数的具体用法?Python indexerApi怎么用?Python indexerApi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了indexerApi函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _xem_exceptions_fetcher

def _xem_exceptions_fetcher():
    if shouldRefresh('xem'):
        for indexer in sickbeard.indexerApi().indexers:
            logger.log(u'Checking for XEM scene exception updates for {0}'.format
                       (sickbeard.indexerApi(indexer).name))

            url = 'http://thexem.de/map/allNames?origin={0}&seasonNumbers=1'.format(sickbeard.indexerApi(indexer).config['xem_origin'])

            parsedJSON = helpers.getURL(url, session=xem_session, timeout=90, returns='json')
            if not parsedJSON:
                logger.log(u'Check scene exceptions update failed for {0}, Unable to get URL: {1}'.format
                           (sickbeard.indexerApi(indexer).name, url), logger.DEBUG)
                continue

            if parsedJSON['result'] == 'failure':
                continue

            if not parsedJSON['data']:
                logger.log(u'No data returned from XEM when checking scene exceptions. Update failed for {0}'.format
                           (sickbeard.indexerApi(indexer).name), logger.DEBUG)
                continue

            for indexerid, names in iteritems(parsedJSON['data']):
                try:
                    xem_exception_dict[int(indexerid)] = names
                except Exception as error:
                    logger.log(u'XEM: Rejected entry: indexerid:{0}; names:{1}'.format(indexerid, names), logger.WARNING)
                    logger.log(u'XEM: Rejected entry error message:{0}'.format(error), logger.DEBUG)

        setLastRefresh('xem')

    return xem_exception_dict
开发者ID:Thraxis,项目名称:pymedusa,代码行数:32,代码来源:scene_exceptions.py


示例2: _ep_data

    def _ep_data(self, ep_obj):
        """
        Creates an elementTree XML structure for a Kodi-style episode.nfo and
        returns the resulting data object.
            show_obj: a TVEpisode instance to create the NFO for
        """

        eps_to_write = [ep_obj] + ep_obj.relatedEps

        indexer_lang = ep_obj.show.lang

        lINDEXER_API_PARMS = sickbeard.indexerApi(ep_obj.show.indexer).api_params.copy()

        lINDEXER_API_PARMS["actors"] = True

        if indexer_lang and not indexer_lang == "en":
            lINDEXER_API_PARMS["language"] = indexer_lang

        if ep_obj.show.dvdorder != 0:
            lINDEXER_API_PARMS["dvdorder"] = True

        try:
            t = sickbeard.indexerApi(ep_obj.show.indexer).indexer(**lINDEXER_API_PARMS)
            myShow = t[ep_obj.show.indexerid]
        except sickbeard.indexer_shownotfound, e:
            raise exceptions.ShowNotFoundException(e.message)
开发者ID:Rawh,项目名称:SickGear,代码行数:26,代码来源:kodi.py


示例3: run

    def run(self, force=False):

        update_datetime = datetime.datetime.now()
        update_date = update_datetime.date()

        logger.log(u"Doing full update on all shows")

        # clean out cache directory, remove everything > 12 hours old
        if sickbeard.CACHE_DIR:
            for indexer in sickbeard.indexerApi().indexers:
                cache_dir = sickbeard.indexerApi(indexer).cache
                logger.log(u"Trying to clean cache folder " + cache_dir)

                # Does our cache_dir exists
                if not ek.ek(os.path.isdir, cache_dir):
                    logger.log(u"Can't clean " + cache_dir + " if it doesn't exist", logger.WARNING)
                else:
                    max_age = datetime.timedelta(hours=12)
                    # Get all our cache files
                    cache_files = ek.ek(os.listdir, cache_dir)

                    for cache_file in cache_files:
                        cache_file_path = ek.ek(os.path.join, cache_dir, cache_file)

                        if ek.ek(os.path.isfile, cache_file_path):
                            cache_file_modified = datetime.datetime.fromtimestamp(
                                ek.ek(os.path.getmtime, cache_file_path))

                            if update_datetime - cache_file_modified > max_age:
                                try:
                                    ek.ek(os.remove, cache_file_path)
                                except OSError, e:
                                    logger.log(u"Unable to clean " + cache_dir + ": " + repr(e) + " / " + str(e),
                                               logger.WARNING)
                                    break
开发者ID:jbwdevos,项目名称:SickRage,代码行数:35,代码来源:showUpdater.py


示例4: _xem_exceptions_fetcher

def _xem_exceptions_fetcher():
    global xem_exception_dict

    xem_list = 'xem_us'
    for show in sickbeard.showList:
        if show.is_anime and not show.paused:
            xem_list = 'xem'
            break

    if shouldRefresh(xem_list):
        for indexer in [i for i in sickbeard.indexerApi().indexers if 'xem_origin' in sickbeard.indexerApi(i).config]:
            logger.log(u'Checking for XEM scene exception updates for %s' % sickbeard.indexerApi(indexer).name)

            url = 'http://thexem.de/map/allNames?origin=%s%s&seasonNumbers=1'\
                  % (sickbeard.indexerApi(indexer).config['xem_origin'], ('&language=us', '')['xem' == xem_list])

            parsed_json = helpers.getURL(url, json=True, timeout=90)
            if not parsed_json:
                logger.log(u'Check scene exceptions update failed for %s, Unable to get URL: %s'
                           % (sickbeard.indexerApi(indexer).name, url), logger.ERROR)
                continue

            if 'failure' == parsed_json['result']:
                continue

            for indexerid, names in parsed_json['data'].items():
                try:
                    xem_exception_dict[int(indexerid)] = names
                except:
                    continue

        setLastRefresh(xem_list)

    return xem_exception_dict
开发者ID:JackDandy,项目名称:SickGear,代码行数:34,代码来源:scene_exceptions.py


示例5: searchIndexerForShowID

def searchIndexerForShowID(regShowName, indexer=None, indexer_id=None, ui=None):
    showNames = list(set([re.sub('[. -]', ' ', regShowName), regShowName]))

    # Query Indexers for each search term and build the list of results
    for indexer in sickbeard.indexerApi().indexers if not indexer else [int(indexer)]:
        # Query Indexers for each search term and build the list of results
        lINDEXER_API_PARMS = sickbeard.indexerApi(indexer).api_params.copy()
        if ui: lINDEXER_API_PARMS['custom_ui'] = ui
        t = sickbeard.indexerApi(indexer).indexer(**lINDEXER_API_PARMS)

        for name in showNames:
            logger.log(u"Trying to find " + name + " on " + sickbeard.indexerApi(indexer).name, logger.DEBUG)
            try:
                search = t[indexer_id] if indexer_id else t[name]

                # add search results
                for i in range(len(search)):
                    part = search[i]
                    seriesname = part['seriesname'].lower()

                    if str(name).lower() == seriesname or (indexer_id and part['id'] == indexer_id):
                        return [sickbeard.indexerApi(indexer).config['id'], part['id']]

            except KeyError:
                if indexer:
                    break
                else:
                    continue
            except Exception:
                continue
开发者ID:jValdron,项目名称:SickBeard-TVRage,代码行数:30,代码来源:helpers.py


示例6: _xem_exceptions_fetcher

def _xem_exceptions_fetcher():
    global xem_exception_dict

    if shouldRefresh('xem'):
        for indexer in sickbeard.indexerApi().indexers:
            logger.log(u"Checking for XEM scene exception updates for " + sickbeard.indexerApi(indexer).name)

            url = "http://thexem.de/map/allNames?origin=%s&seasonNumbers=1" % sickbeard.indexerApi(indexer).config[
                'xem_origin']

            parsedJSON = helpers.getURL(url, json=True)
            if not parsedJSON:
                logger.log(u"Check scene exceptions update failed for " + sickbeard.indexerApi(
                    indexer).name + ", Unable to get URL: " + url, logger.ERROR)
                continue

            if parsedJSON['result'] == 'failure':
                continue

            for indexerid, names in parsedJSON['data'].items():
                xem_exception_dict[int(indexerid)] = names

        setLastRefresh('xem')

    return xem_exception_dict
开发者ID:GodZZila,项目名称:SickRage,代码行数:25,代码来源:scene_exceptions.py


示例7: _ep_data

    def _ep_data(self, ep_obj):
        """
        Creates an elementTree XML structure for a WDTV style episode.xml
        and returns the resulting data object.

        ep_obj: a TVShow instance to create the NFO for
        """

        eps_to_write = [ep_obj] + ep_obj.relatedEps

        indexer_lang = ep_obj.show.lang

        try:
            lINDEXER_API_PARMS = sickbeard.indexerApi(ep_obj.show.indexer).api_params.copy()

            lINDEXER_API_PARMS['actors'] = True

            if indexer_lang and not indexer_lang == sickbeard.INDEXER_DEFAULT_LANGUAGE:
                lINDEXER_API_PARMS['language'] = indexer_lang

            if ep_obj.show.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(ep_obj.show.indexer).indexer(**lINDEXER_API_PARMS)
            myShow = t[ep_obj.show.indexerid]
        except sickbeard.indexer_shownotfound, e:
            raise ShowNotFoundException(e.message)
开发者ID:markrawlingson,项目名称:SickRage,代码行数:27,代码来源:wdtv.py


示例8: get_show_by_name

def get_show_by_name(name, showList, useIndexer=False):
    logger.log(u"Trying to get the indexerid for " + name, logger.DEBUG)

    if showList:
        for show in showList:
            if _check_against_names(name, show):
                logger.log(u"Matched " + name + " in the showlist to the show " + show.name, logger.DEBUG)
                return show

    if useIndexer:
        for indexer in sickbeard.indexerApi().indexers:
            try:
                lINDEXER_API_PARMS = sickbeard.indexerApi(indexer).api_params.copy()
                lINDEXER_API_PARMS['custom_ui'] = classes.ShowListUI
                lINDEXER_API_PARMS['search_all_languages'] = True

                t = sickbeard.indexerApi(indexer).indexer(**lINDEXER_API_PARMS)
                showObj = t[name]
            except:continue

            if showObj:
                showResult = findCertainShow(sickbeard.showList, int(showObj["id"]))
                if showResult is not None:
                    return showResult

    return None
开发者ID:Wizkidje,项目名称:SickBeard-TVRage,代码行数:26,代码来源:helpers.py


示例9: _ep_data

    def _ep_data(self, ep_obj):
        """
        Creates an elementTree XML structure for a MediaBrowser style episode.xml
        and returns the resulting data object.

        show_obj: a TVShow instance to create the NFO for
        """

        eps_to_write = [ep_obj] + ep_obj.relatedEps

        indexer_lang = ep_obj.show.lang

        try:
            # There's gotta be a better way of doing this but we don't wanna
            # change the language value elsewhere
            lINDEXER_API_PARMS = sickbeard.indexerApi(ep_obj.show.indexer).api_params.copy()

            if indexer_lang and not indexer_lang == sickbeard.INDEXER_DEFAULT_LANGUAGE:
                lINDEXER_API_PARMS['language'] = indexer_lang

            if ep_obj.show.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(ep_obj.show.indexer).indexer(**lINDEXER_API_PARMS)
            myShow = t[ep_obj.show.indexerid]
        except sickbeard.indexer_shownotfound, e:
            raise exceptions.ShowNotFoundException(e.message)
开发者ID:xNovax,项目名称:SickRage,代码行数:27,代码来源:mede8er.py


示例10: _xem_exceptions_fetcher

def _xem_exceptions_fetcher():

    exception_dict = {}

    if shouldRefresh('xem'):
        success = False
        for indexer in sickbeard.indexerApi().indexers:
            logger.log(u"Checking for XEM scene exception updates for " + sickbeard.indexerApi(indexer).name)

            url = "http://thexem.de/map/allNames?origin=%s&seasonNumbers=1" % sickbeard.indexerApi(indexer).config[
                'xem_origin']

            url_data = helpers.getURL(url, json=True)
            if url_data is None:
                logger.log(u"Check scene exceptions update failed for " + sickbeard.indexerApi(
                    indexer).name + ", Unable to get URL: " + url, logger.ERROR)
                continue

            if url_data['result'] == 'failure':
                continue

            for indexerid, names in url_data['data'].items():
                exception_dict[int(indexerid)] = names

            success = True

        if success:
            setLastRefresh('xem')

    return exception_dict
开发者ID:achlee,项目名称:SickRage,代码行数:30,代码来源:scene_exceptions.py


示例11: _get_episode_thumb_url

    def _get_episode_thumb_url(self, ep_obj):
        """
        Returns the URL to use for downloading an episode's thumbnail. Uses
        theTVDB.com and TVRage.com data.

        ep_obj: a TVEpisode object for which to grab the thumb URL
        """
        all_eps = [ep_obj] + ep_obj.relatedEps

        indexer_lang = ep_obj.show.lang

        # get a TVDB object
        try:
            # There's gotta be a better way of doing this but we don't wanna
            # change the language value elsewhere
            lINDEXER_API_PARMS = sickbeard.indexerApi(ep_obj.show.indexer).api_params.copy()

            lINDEXER_API_PARMS['actors'] = True

            if indexer_lang and not indexer_lang == 'en':
                lINDEXER_API_PARMS['language'] = indexer_lang

            if ep_obj.show.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(ep_obj.show.indexer).indexer(**lINDEXER_API_PARMS)

            indexer_show_obj = t[ep_obj.show.indexerid]
        except sickbeard.indexer_shownotfound, e:
            raise exceptions.ShowNotFoundException(e.message)
开发者ID:DarkSpikeX,项目名称:SickBeard-TVRage,代码行数:30,代码来源:generic.py


示例12: _ep_data

    def _ep_data(self, ep_obj):
        """
        Creates an elementTree XML structure for a MediaBrowser style episode.xml
        and returns the resulting data object.

        show_obj: a TVShow instance to create the NFO for
        """

        eps_to_write = [ep_obj] + ep_obj.relatedEps

        persons_dict = {}
        persons_dict['Director'] = []
        persons_dict['GuestStar'] = []
        persons_dict['Writer'] = []

        indexer_lang = ep_obj.show.lang

        try:
            lINDEXER_API_PARMS = sickbeard.indexerApi(ep_obj.show.indexer).api_params.copy()

            lINDEXER_API_PARMS['actors'] = True

            if indexer_lang and not indexer_lang == 'en':
                lINDEXER_API_PARMS['language'] = indexer_lang

            if ep_obj.show.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(ep_obj.show.indexer).indexer(**lINDEXER_API_PARMS)

            myShow = t[ep_obj.show.indexerid]
        except sickbeard.indexer_shownotfound, e:
            raise exceptions.ShowNotFoundException(e.message)
开发者ID:Eiber,项目名称:OLD-Sickrage,代码行数:33,代码来源:mediabrowser.py


示例13: _retrieve_show_image

    def _retrieve_show_image(self, image_type, show_obj, which=None):
        """
        Gets an image URL from theTVDB.com and TMDB.com, downloads it and returns the data.

        image_type: type of image to retrieve (currently supported: fanart, poster, banner)
        show_obj: a TVShow object to use when searching for the image
        which: optional, a specific numbered poster to look for

        Returns: the binary image data if available, or else None
        """
        image_url = None
        indexer_lang = show_obj.lang

        try:
            # There's gotta be a better way of doing this but we don't wanna
            # change the language value elsewhere
            lINDEXER_API_PARMS = sickbeard.indexerApi(show_obj.indexer).api_params.copy()

            lINDEXER_API_PARMS['banners'] = True

            if indexer_lang and not indexer_lang == sickbeard.INDEXER_DEFAULT_LANGUAGE:
                lINDEXER_API_PARMS['language'] = indexer_lang

            if show_obj.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(show_obj.indexer).indexer(**lINDEXER_API_PARMS)
            indexer_show_obj = t[show_obj.indexerid]
        except (sickbeard.indexer_error, IOError) as e:
            logger.log(u"Unable to look up show on " + sickbeard.indexerApi(
                show_obj.indexer).name + ", not downloading images: " + ex(e), logger.WARNING)
            logger.log(u"%s may be experiencing some problems. Try again later." % sickbeard.indexerApi(show_obj.indexer).name, logger.DEBUG)
            return None

        if image_type not in ('fanart', 'poster', 'banner', 'poster_thumb', 'banner_thumb'):
            logger.log(u"Invalid image type " + str(image_type) + ", couldn't find it in the " + sickbeard.indexerApi(
                show_obj.indexer).name + " object", logger.ERROR)
            return None

        if image_type == 'poster_thumb':
            if getattr(indexer_show_obj, 'poster', None):
                image_url = re.sub('posters', '_cache/posters', indexer_show_obj['poster'])
            if not image_url:
                # Try and get images from TMDB
                image_url = self._retrieve_show_images_from_tmdb(show_obj, image_type)
        elif image_type == 'banner_thumb':
            if getattr(indexer_show_obj, 'banner', None):
                image_url = re.sub('graphical', '_cache/graphical', indexer_show_obj['banner'])
        else:
            if getattr(indexer_show_obj, image_type, None):
                image_url = indexer_show_obj[image_type]
            if not image_url:
                # Try and get images from TMDB
                image_url = self._retrieve_show_images_from_tmdb(show_obj, image_type)

        if image_url:
            image_data = metadata_helpers.getShowImage(image_url, which)
            return image_data

        return None
开发者ID:Thraxis,项目名称:pymedusa,代码行数:60,代码来源:generic.py


示例14: _xem_refresh

def _xem_refresh(indexer_id, indexer):
    """
    Refresh data from xem for a tv show
    
    @param indexer_id: int
    """
    if indexer_id is None:
        return

    indexer_id = int(indexer_id)
    indexer = int(indexer)

    try:
        logger.log(
            u'Looking up XEM scene mapping for show %s on %s' % (indexer_id, sickbeard.indexerApi(indexer).name,),
            logger.DEBUG)
        data = requests.get("http://thexem.de/map/all?id=%s&origin=%s&destination=scene" % (
            indexer_id, sickbeard.indexerApi(indexer).config['xem_origin'],), verify=False).json()

        if data is None or data == '':
            logger.log(u'No XEN data for show "%s on %s", trying TVTumbler' % (
                indexer_id, sickbeard.indexerApi(indexer).name,), logger.MESSAGE)
            data = requests.get("http://show-api.tvtumbler.com/api/thexem/all?id=%s&origin=%s&destination=scene" % (
                indexer_id, sickbeard.indexerApi(indexer).config['xem_origin'],), verify=False).json()
            if data is None or data == '':
                logger.log(u'TVTumbler also failed for show "%s on %s".  giving up.' % (indexer_id, indexer,),
                           logger.MESSAGE)
                return None

        result = data
        if result:
            cacheDB = db.DBConnection('cache.db')
            cacheDB.action("INSERT OR REPLACE INTO xem_refresh (indexer, indexer_id, last_refreshed) VALUES (?,?,?)",
                           [indexer, indexer_id, time.time()])
            if 'success' in result['result']:
                cacheDB.action("DELETE FROM xem_numbering where indexer = ? and indexer_id = ?", [indexer, indexer_id])
                for entry in result['data']:
                    if 'scene' in entry:
                        cacheDB.action(
                            "INSERT INTO xem_numbering (indexer, indexer_id, season, episode, scene_season, scene_episode) VALUES (?,?,?,?,?,?)",
                            [indexer, indexer_id, entry[sickbeard.indexerApi(indexer).config['xem_origin']]['season'],
                             entry[sickbeard.indexerApi(indexer).config['xem_origin']]['episode'],
                             entry['scene']['season'], entry['scene']['episode']])
                    if 'scene_2' in entry:  # for doubles
                        cacheDB.action(
                            "INSERT INTO xem_numbering (indexer, indexer_id, season, episode, scene_season, scene_episode) VALUES (?,?,?,?,?,?)",
                            [indexer, indexer_id, entry[sickbeard.indexerApi(indexer).config['xem_origin']]['season'],
                             entry[sickbeard.indexerApi(indexer).config['xem_origin']]['episode'],
                             entry['scene_2']['season'], entry['scene_2']['episode']])
            else:
                logger.log(u'Failed to get XEM scene data for show %s from %s because "%s"' % (
                    indexer_id, sickbeard.indexerApi(indexer).name, result['message']), logger.DEBUG)
        else:
            logger.log(u"Empty lookup result - no XEM data for show %s on %s" % (
                indexer_id, sickbeard.indexerApi(indexer).name,), logger.DEBUG)
    except Exception, e:
        logger.log(u"Exception while refreshing XEM data for show " + str(indexer_id) + " on " + sickbeard.indexerApi(
            indexer).name + ": " + ex(e), logger.WARNING)
        logger.log(traceback.format_exc(), logger.DEBUG)
        return None
开发者ID:Bespatter,项目名称:SickRage,代码行数:60,代码来源:scene_numbering.py


示例15: get_xem_ids

def get_xem_ids():
    global xem_ids_list

    for iid, name in sickbeard.indexerApi().xem_supported_indexers.iteritems():
        xem_ids = _xem_get_ids(name, sickbeard.indexerApi(iid).config['xem_origin'])
        if len(xem_ids):
            xem_ids_list[iid] = xem_ids
开发者ID:JackDandy,项目名称:SickGear,代码行数:7,代码来源:scene_exceptions.py


示例16: _xem_exceptions_fetcher

def _xem_exceptions_fetcher():
    global xem_exception_dict
    global xem_session

    if shouldRefresh('xem'):
        for indexer in sickbeard.indexerApi().indexers:
            logger.log(u"Checking for XEM scene exception updates for " + sickbeard.indexerApi(indexer).name)

            url = "http://thexem.de/map/allNames?origin=%s&seasonNumbers=1" % sickbeard.indexerApi(indexer).config[
                'xem_origin']

            parsedJSON = helpers.getURL(url, session=xem_session, json=True)
            if not parsedJSON:
                logger.log(u"Check scene exceptions update failed for " + sickbeard.indexerApi(
                    indexer).name + ", Unable to get URL: " + url, logger.ERROR)
                continue

            if parsedJSON['result'] == 'failure':
                continue

            for indexerid, names in parsedJSON['data'].iteritems():
                try:
                    xem_exception_dict[int(indexerid)] = names
                except Exception as e:
                    logger.log(u"XEM: Rejected entry: indexerid:{0}; names:{1}".format(indexerid, names), logger.WARNING)
                    logger.log(u"XEM: Rejected entry error message:{0}".format(str(e)), logger.DEBUG)

        setLastRefresh('xem')

    return xem_exception_dict
开发者ID:Joe00,项目名称:SickRage,代码行数:30,代码来源:scene_exceptions.py


示例17: searchIndexerForShowID

def searchIndexerForShowID(regShowName, indexer=None, indexer_id=None, ui=True):
    showNames = list(set([re.sub('[. -]', ' ', regShowName), regShowName]))

    # Query Indexers for each search term and build the list of results
    for indexer in sickbeard.indexerApi().indexers if not indexer else [int(indexer)]:
        # Query Indexers for each search term and build the list of results
        lINDEXER_API_PARMS = sickbeard.indexerApi(indexer).api_params.copy()
        if ui:lINDEXER_API_PARMS['custom_ui'] = classes.ShowListUI
        t = sickbeard.indexerApi(indexer).indexer(**lINDEXER_API_PARMS)

        for name in showNames:
            logger.log(u"Trying to find " + name + " on " + sickbeard.indexerApi(indexer).name, logger.DEBUG)
            try:
                if indexer_id:
                    search = t[indexer_id]
                else:
                    search = t[name]

                if isinstance(search, dict):
                    search = [search]

                # add search results
                for i in range(len(search)):
                    part = search[i]
                    seriesname = part['seriesname'].encode('UTF-8').lower()
                    name = name.encode('UTF-8').lower()

                    if (name in seriesname) or (indexer_id is not None and part['id'] == indexer_id):
                        return [sickbeard.indexerApi(indexer).config['id'], part['id']]

            except KeyError:break
            except Exception:continue
开发者ID:Wizkidje,项目名称:SickBeard-TVRage,代码行数:32,代码来源:helpers.py


示例18: _retrieve_show_image

    def _retrieve_show_image(self, image_type, show_obj, which=None):
        """
        Gets an image URL from theTVDB.com and TMDB.com, downloads it and returns the data.

        image_type: type of image to retrieve (currently supported: fanart, poster, banner)
        show_obj: a TVShow object to use when searching for the image
        which: optional, a specific numbered poster to look for

        Returns: the binary image data if available, or else None
        """
        image_url = None
        indexer_lang = show_obj.lang

        try:
            # There's gotta be a better way of doing this but we don't wanna
            # change the language value elsewhere
            lINDEXER_API_PARMS = sickbeard.indexerApi(show_obj.indexer).api_params.copy()

            lINDEXER_API_PARMS['banners'] = True

            if indexer_lang and not indexer_lang == sickbeard.INDEXER_DEFAULT_LANGUAGE:
                lINDEXER_API_PARMS['language'] = indexer_lang

            if show_obj.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(show_obj.indexer).indexer(**lINDEXER_API_PARMS)
            indexer_show_obj = t[show_obj.indexerid]
        except (sickbeard.indexer_error, IOError), e:
            logger.log(u"Unable to look up show on " + sickbeard.indexerApi(
                show_obj.indexer).name + ", not downloading images: " + ex(e), logger.WARNING)
            logger.log(u"Indexer " + sickbeard.indexerApi(show_obj.indexer).name + "maybe experiencing some problems. Try again later", logger.DEBUG)
            return None
开发者ID:feld,项目名称:SickRage,代码行数:33,代码来源:generic.py


示例19: _season_banners_dict

    def _season_banners_dict(self, show_obj, season):
        """
        Should return a dict like:

        result = {<season number>:
                    {1: '<url 1>', 2: <url 2>, ...},}
        """

        # This holds our resulting dictionary of season art
        result = {}

        indexer_lang = show_obj.lang

        try:
            # There's gotta be a better way of doing this but we don't wanna
            # change the language value elsewhere
            lINDEXER_API_PARMS = sickbeard.indexerApi(show_obj.indexer).api_params.copy()

            lINDEXER_API_PARMS['banners'] = True

            if indexer_lang and not indexer_lang == sickbeard.INDEXER_DEFAULT_LANGUAGE:
                lINDEXER_API_PARMS['language'] = indexer_lang

            t = sickbeard.indexerApi(show_obj.indexer).indexer(**lINDEXER_API_PARMS)
            indexer_show_obj = t[show_obj.indexerid]
        except (sickbeard.indexer_error, IOError), e:
            logger.log(u"Unable to look up show on " + sickbeard.indexerApi(
                show_obj.indexer).name + ", not downloading images: " + ex(e), logger.WARNING)
            logger.log(u"Indexer " + sickbeard.indexerApi(show_obj.indexer).name + "maybe experiencing some problems. Try again later", logger.DEBUG)
            return result
开发者ID:feld,项目名称:SickRage,代码行数:30,代码来源:generic.py


示例20: _season_posters_dict

    def _season_posters_dict(self, show_obj, season):
        """
        Should return a dict like:

        result = {<season number>:
                    {1: '<url 1>', 2: <url 2>, ...},}
        """

        # This holds our resulting dictionary of season art
        result = {}

        indexer_lang = show_obj.lang

        try:
            # There's gotta be a better way of doing this but we don't wanna
            # change the language value elsewhere
            lINDEXER_API_PARMS = sickbeard.indexerApi(show_obj.indexer).api_params.copy()

            lINDEXER_API_PARMS['banners'] = True

            if indexer_lang and not indexer_lang == 'en':
                lINDEXER_API_PARMS['language'] = indexer_lang

            if show_obj.dvdorder != 0:
                lINDEXER_API_PARMS['dvdorder'] = True

            t = sickbeard.indexerApi(show_obj.indexer).indexer(**lINDEXER_API_PARMS)
            indexer_show_obj = t[show_obj.indexerid]
        except (sickbeard.indexer_error, IOError), e:
            logger.log(u"Unable to look up show on " + sickbeard.indexerApi(
                show_obj.indexer).name + ", not downloading images: " + ex(e), logger.ERROR)
            return result
开发者ID:3ne,项目名称:SickRage,代码行数:32,代码来源:generic.py



注:本文中的sickbeard.indexerApi函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sickbeard.initialize函数代码示例发布时间:2022-05-27
下一篇:
Python sickbeard.halt函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap