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

Python providers.sortedProviderList函数代码示例

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

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



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

示例1: searchProviders

def searchProviders(show, season, episode=None, manualSearch=False):
    logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))
    foundResults = {}

    didSearch = False
    seasonSearch = False

    # gather all episodes for season and then pick out the wanted episodes and compare to determin if we want whole season or just a few episodes
    if episode is None:
        seasonEps = show.getAllEpisodes(season)
        wantedEps = [x for x in seasonEps if show.getOverview(x.status) in (Overview.WANTED, Overview.QUAL)]
        if len(seasonEps) == len(wantedEps):
            seasonSearch = True
    else:
        ep_obj = show.getEpisode(season, episode)
        wantedEps = [ep_obj]

    for curProvider in providers.sortedProviderList():
        if not curProvider.isActive():
            continue

        # update cache
        if manualSearch:
            curProvider.cache.updateCache()

        # search cache first for wanted episodes
        for ep_obj in wantedEps:
            curResults = curProvider.cache.searchCache(ep_obj, manualSearch)
            curResults = filterSearchResults(show, curResults)
            if len(curResults):
                foundResults.update(curResults)
                logger.log(u"Cache results: " + repr(foundResults), logger.DEBUG)
                didSearch = True

    if not len(foundResults):
        for curProvider in providers.sortedProviderList():
            if not curProvider.isActive():
                continue

            try:
                curResults = curProvider.getSearchResults(show, season, wantedEps, seasonSearch, manualSearch)
            except exceptions.AuthException, e:
                logger.log(u"Authentication error: " + ex(e), logger.ERROR)
                continue
            except Exception, e:
                logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
                logger.log(traceback.format_exc(), logger.DEBUG)
                continue

            # finished searching this provider successfully
            didSearch = True

            curResults = filterSearchResults(show, curResults)
            if len(curResults):
                foundResults.update(curResults)
                logger.log(u"Provider search results: " + str(foundResults), logger.DEBUG)
开发者ID:Acio,项目名称:SickBeard-TVRage,代码行数:56,代码来源:search.py


示例2: _getProperList

    def _getProperList(self):

        propers = {}

        # for each provider get a list of the propers
        for curProvider in providers.sortedProviderList():

            if not curProvider.isActive():
                continue

            search_date = datetime.datetime.today() - datetime.timedelta(days=2)

            logger.log(u"Searching for any new PROPER releases from " + curProvider.name)
            try:
                curPropers = curProvider.findPropers(search_date)
            except exceptions.AuthException, e:
                logger.log(u"Authentication error: " + ex(e), logger.ERROR)
                continue

            # if they haven't been added by a different provider than add the proper to the list
            for x in curPropers:
                time.sleep(0.01)
                showObj = helpers.findCertainShow(sickbeard.showList, x.indexerid)
                if not showObj:
                    logger.log(u"Unable to find the show we watch with indexerID " + str(x.indexerid), logger.ERROR)
                    continue

                name = self._genericName(x.name)

                if not name in propers:
                    logger.log(u"Found new proper: " + x.name, logger.DEBUG)
                    x.provider = curProvider
                    propers[name] = x
开发者ID:3ne,项目名称:SickRage,代码行数:33,代码来源:properFinder.py


示例3: _getProperList

    def _getProperList(self):

        propers = {}

        # for each provider get a list of the propers
        for curProvider in providers.sortedProviderList():

            if not curProvider.isActive():
                continue

            search_date = datetime.datetime.today() - datetime.timedelta(days=2)

            logger.log(u"Searching for any new PROPER releases from " + curProvider.name)
            try:
                curPropers = curProvider.findPropers(search_date)
            except exceptions.AuthException, e:
                logger.log(u"Authentication error: " + ex(e), logger.ERROR)
                continue

            # if they haven't been added by a different provider than add the proper to the list
            for x in curPropers:
                name = self._genericName(x.name)

                if not name in propers:
                    logger.log(u"Found new proper: " + x.name, logger.DEBUG)
                    x.provider = curProvider
                    propers[name] = x
开发者ID:PermaNulled,项目名称:SickBeard-XG,代码行数:27,代码来源:properFinder.py


示例4: findSeason

def findSeason(show, season):

    logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))

    foundResults = {}

    didSearch = False

    for curProvider in providers.sortedProviderList():

        if not curProvider.isActive():
            continue

        try:
            curResults = curProvider.findSeasonResults(show, season)

            # make a list of all the results for this provider
            for curEp in curResults:

                # skip non-tv crap
                curResults[curEp] = filter(lambda x: show_name_helpers.filterBadReleases(x.name) and show_name_helpers.isGoodResult(x.name, show), curResults[curEp])

                if curEp in foundResults:
                    foundResults[curEp] += curResults[curEp]
                else:
                    foundResults[curEp] = curResults[curEp]

        except exceptions.AuthException, e:
            logger.log(u"Authentication error: " + ex(e), logger.ERROR)
            continue
        except Exception, e:
            logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
            logger.log(traceback.format_exc(), logger.DEBUG)
            continue
开发者ID:DanaMcCarthy,项目名称:Sick-Beard,代码行数:34,代码来源:search.py


示例5: searchForNeededEpisodes

def searchForNeededEpisodes():

    logger.log(u"Searching all providers for any needed episodes")

    foundResults = {}

    didSearch = False

    # ask all providers for any episodes it finds
    for curProvider in providers.sortedProviderList():

        if not curProvider.isActive():
            continue

        curFoundResults = {}

        try:
            curFoundResults = curProvider.searchRSS()
        except exceptions.AuthException, e:
            logger.log(u"Authentication error: " + ex(e), logger.ERROR)
            continue
        except Exception, e:
            logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
            logger.log(traceback.format_exc(), logger.DEBUG)
            continue
开发者ID:DanaMcCarthy,项目名称:Sick-Beard,代码行数:25,代码来源:search.py


示例6: findSeason

def findSeason(show, season):

    myDB = db.DBConnection()
    allEps = [int(x["episode"]) for x in myDB.select("SELECT episode FROM tv_episodes WHERE showid = ? AND season = ?", [show.tvdbid, season])]
    logger.log(u"Episode list: "+str(allEps), logger.DEBUG)

    
    reallywanted=[]
    notwanted=[]
    finalResults = []
    for curEpNum in allEps:
        sqlResults = myDB.select("SELECT status FROM tv_episodes WHERE showid = ? AND season = ? AND episode = ?", [show.tvdbid, season, curEpNum])
        epStatus = int(sqlResults[0]["status"])
        if epStatus ==3:
            reallywanted.append(curEpNum)
        else:
            notwanted.append(curEpNum)
    if notwanted != []:
        for EpNum in reallywanted:
            showObj = sickbeard.helpers.findCertainShow(sickbeard.showList, show.tvdbid)
            episode = showObj.getEpisode(season, EpNum)
            res=findEpisode(episode, manualSearch=True)
            snatchEpisode(res)
        return
    else:
        logger.log(u"Searching for stuff we need from "+show.name+" season "+str(season))
    
        foundResults = {}
    
        didSearch = False
    
        for curProvider in providers.sortedProviderList():
    
            if not curProvider.isActive():
                continue
    
            try:
                curResults = curProvider.findSeasonResults(show, season)
    
                # make a list of all the results for this provider
                for curEp in curResults:
    
                    # skip non-tv crap
                    curResults[curEp] = filter(lambda x:  show_name_helpers.filterBadReleases(x.name) and show_name_helpers.isGoodResult(x.name, show), curResults[curEp])
    
                    if curEp in foundResults:
                        foundResults[curEp] += curResults[curEp]
                    else:
                        foundResults[curEp] = curResults[curEp]
    
            except exceptions.AuthException, e:
                logger.log(u"Authentication error: "+ex(e), logger.ERROR)
                continue
            except Exception, e:
                logger.log(u"Error while searching "+curProvider.name+", skipping: "+ex(e), logger.DEBUG)
                logger.log(traceback.format_exc(), logger.DEBUG)
                continue
    
            didSearch = True
开发者ID:ClubSoundZ,项目名称:Sick-Beard,代码行数:59,代码来源:search.py


示例7: _migrate_v6

    def _migrate_v6(self):
        sickbeard.RECENTSEARCH_FREQUENCY = check_setting_int(self.config_obj, 'General', 'dailysearch_frequency',
                                                             sickbeard.DEFAULT_RECENTSEARCH_FREQUENCY)

        sickbeard.RECENTSEARCH_STARTUP = bool(check_setting_int(self.config_obj, 'General', 'dailysearch_startup', 1))
        if sickbeard.RECENTSEARCH_FREQUENCY < sickbeard.MIN_RECENTSEARCH_FREQUENCY:
            sickbeard.RECENTSEARCH_FREQUENCY = sickbeard.MIN_RECENTSEARCH_FREQUENCY

        for curProvider in providers.sortedProviderList():
            if hasattr(curProvider, 'enable_recentsearch'):
                curProvider.enable_recentsearch = bool(check_setting_int(
                    self.config_obj, curProvider.get_id().upper(), curProvider.get_id() + '_enable_dailysearch', 1))
开发者ID:joshguerette,项目名称:SickGear,代码行数:12,代码来源:config.py


示例8: searchProviders

def searchProviders(show, season, episode=None, manualSearch=False):
    logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))

    foundResults = {}

    didSearch = False
    seasonSearch = False

    # gather all episodes for season and then pick out the wanted episodes and compare to determin if we want whole season or just a few episodes
    if episode is None:
        seasonEps = show.getAllEpisodes(season)
        wantedEps = [x for x in seasonEps if show.getOverview(x.status) in (Overview.WANTED, Overview.QUAL)]
        if len(seasonEps) == len(wantedEps):
            seasonSearch = True
    else:
        ep_obj = show.getEpisode(season, episode)
        wantedEps = [ep_obj]

    for curProvider in providers.sortedProviderList():

        if not curProvider.isActive():
            continue

        try:
            curResults = curProvider.getSearchResults(show, season, wantedEps, seasonSearch, manualSearch)

            # make a list of all the results for this provider
            for curEp in curResults:

                # skip non-tv crap
                curResults[curEp] = filter(
                    lambda x: show_name_helpers.filterBadReleases(x.name) and show_name_helpers.isGoodResult(x.name,
                                                                                                             show),
                    curResults[curEp])

                if curEp in foundResults:
                    foundResults[curEp] += curResults[curEp]
                else:
                    foundResults[curEp] = curResults[curEp]

        except exceptions.AuthException, e:
            logger.log(u"Authentication error: " + ex(e), logger.ERROR)
            continue
        except Exception, e:
            logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
            logger.log(traceback.format_exc(), logger.DEBUG)
            continue
开发者ID:jfrmn,项目名称:SickBeard-TVRage,代码行数:47,代码来源:search.py


示例9: searchProviders

def searchProviders(show, season, episodes, seasonSearch=False, manualSearch=False):
    logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))
    foundResults = {}

    didSearch = False

    for curProvider in providers.sortedProviderList():
        if not curProvider.isActive():
            continue

        try:
            curResults = curProvider.findSearchResults(show, season, episodes, seasonSearch, manualSearch)
        except exceptions.AuthException, e:
            logger.log(u"Authentication error: " + ex(e), logger.ERROR)
            continue
        except Exception, e:
            logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
            logger.log(traceback.format_exc(), logger.DEBUG)
            continue
开发者ID:Xennon1,项目名称:SickBeard-TVRage,代码行数:19,代码来源:search.py


示例10: findEpisode

def findEpisode(episode, manualSearch=False):
    logger.log(u"Searching for " + episode.prettyName())

    foundResults = []

    didSearch = False

    for curProvider in providers.sortedProviderList():

        if not curProvider.isActive():
            continue

        try:
            curFoundResults = curProvider.findEpisode(episode, manualSearch=manualSearch)
        except exceptions.AuthException, e:
            logger.log(u"Authentication error: " + ex(e), logger.ERROR)
            continue
        except Exception, e:
            logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
            logger.log(traceback.format_exc(), logger.DEBUG)
            continue
开发者ID:Prinz23,项目名称:SickBeard-TVRage,代码行数:21,代码来源:search.py


示例11: get_data

    def get_data(self, url):
        result = None
        data_json = self.get_url(url % dict(ts=self.ts()), json=True)
        if self.should_skip():
            return result
        url = data_json.get('url', '')
        if url.lower().startswith('magnet:'):
            result = url
        else:
            from sickbeard import providers
            if 'torlock' in url.lower():
                prov = (filter(lambda p: 'torlock' == p.name.lower(), (filter(
                    lambda sp: sp.providerType == self.providerType, providers.sortedProviderList()))))[0]
                state = prov.enabled
                prov.enabled = True
                _ = prov.url
                prov.enabled = state
                if prov.url:
                    try:
                        result = prov.urls.get('get', '') % re.findall(r'(\d+).torrent', url)[0]
                    except (IndexError, TypeError):
                        pass

        return result
开发者ID:JackDandy,项目名称:SickGear,代码行数:24,代码来源:snowfl.py


示例12: SNI_Tests

import unittest

from tests import SiCKRAGETestCase

import certifi
import requests
import sickbeard.providers as providers
from sickrage.helper.exceptions import ex

class SNI_Tests(SiCKRAGETestCase): pass

def test_sni(self, provider):
    try:
        requests.head(provider.url, verify=certifi.where(), timeout=5)
    except requests.exceptions.Timeout:
        pass
    except requests.exceptions.SSLError as error:
        if 'SSL3_GET_SERVER_CERTIFICATE' not in ex(error):
            print(error)
    except Exception:
        pass

for provider in providers.sortedProviderList():
    setattr(SNI_Tests, 'test_%s' % provider.name, lambda self, x=provider: test_sni(self, x))

if __name__ == "__main__":
    print("==================")
    print("STARTING - SSL TESTS")
    print("==================")
    print("######################################################################")
    unittest.main()
开发者ID:coderbone,项目名称:SickRage,代码行数:31,代码来源:test_ssl_sni.py


示例13: save_config

def save_config():

    new_config = ConfigObj()
    new_config.filename = sickbeard.CONFIG_FILE

    new_config['General'] = {}
    new_config['General']['log_dir'] = LOG_DIR
    new_config['General']['web_port'] = WEB_PORT
    new_config['General']['web_host'] = WEB_HOST
    new_config['General']['web_ipv6'] = WEB_IPV6
    new_config['General']['web_log'] = int(WEB_LOG)
    new_config['General']['web_root'] = WEB_ROOT
    new_config['General']['web_username'] = WEB_USERNAME
    new_config['General']['web_password'] = WEB_PASSWORD
    new_config['General']['nzb_method'] = NZB_METHOD
    new_config['General']['usenet_retention'] = int(USENET_RETENTION)
    new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY)
    new_config['General']['backlog_search_frequency'] = int(BACKLOG_SEARCH_FREQUENCY)
    new_config['General']['use_nzb'] = int(USE_NZB)
    new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS)
    new_config['General']['quality_default'] = int(QUALITY_DEFAULT)
    new_config['General']['season_folders_format'] = SEASON_FOLDERS_FORMAT
    new_config['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT)
    new_config['General']['provider_order'] = ' '.join([x.getID() for x in providers.sortedProviderList()])
    new_config['General']['version_notify'] = int(VERSION_NOTIFY)
    new_config['General']['naming_ep_name'] = int(NAMING_EP_NAME)
    new_config['General']['naming_show_name'] = int(NAMING_SHOW_NAME)
    new_config['General']['naming_ep_type'] = int(NAMING_EP_TYPE)
    new_config['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE)
    new_config['General']['naming_sep_type'] = int(NAMING_SEP_TYPE)
    new_config['General']['naming_use_periods'] = int(NAMING_USE_PERIODS)
    new_config['General']['naming_quality'] = int(NAMING_QUALITY)
    new_config['General']['naming_dates'] = int(NAMING_DATES)
    new_config['General']['use_torrent'] = int(USE_TORRENT)
    new_config['General']['launch_browser'] = int(LAUNCH_BROWSER)
    new_config['General']['metadata_type'] = METADATA_TYPE
    new_config['General']['metadata_show'] = int(METADATA_SHOW)
    new_config['General']['metadata_episode'] = int(METADATA_EPISODE)
    new_config['General']['art_poster'] = int(ART_POSTER)
    new_config['General']['art_fanart'] = int(ART_FANART)
    new_config['General']['art_thumbnails'] = int(ART_THUMBNAILS)
    new_config['General']['art_season_thumbnails'] = int(ART_SEASON_THUMBNAILS)
    new_config['General']['cache_dir'] = CACHE_DIR
    new_config['General']['tv_download_dir'] = TV_DOWNLOAD_DIR
    new_config['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR)
    new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY)
    new_config['General']['rename_episodes'] = int(RENAME_EPISODES)
    
    new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS)
    new_config['General']['git_path'] = GIT_PATH

    new_config['Blackhole'] = {}
    new_config['Blackhole']['nzb_dir'] = NZB_DIR
    new_config['Blackhole']['torrent_dir'] = TORRENT_DIR

    new_config['TVBinz'] = {}
    new_config['TVBinz']['tvbinz'] = int(TVBINZ)
    new_config['TVBinz']['tvbinz_uid'] = TVBINZ_UID
    new_config['TVBinz']['tvbinz_hash'] = TVBINZ_HASH
    new_config['TVBinz']['tvbinz_auth'] = TVBINZ_AUTH

    new_config['NZBs'] = {}
    new_config['NZBs']['nzbs'] = int(NZBS)
    new_config['NZBs']['nzbs_uid'] = NZBS_UID
    new_config['NZBs']['nzbs_hash'] = NZBS_HASH

    new_config['NZBsRUS'] = {}
    new_config['NZBsRUS']['nzbsrus'] = int(NZBSRUS)
    new_config['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID
    new_config['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH

    new_config['NZBMatrix'] = {}
    new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX)
    new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME
    new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY

    new_config['Newzbin'] = {}
    new_config['Newzbin']['newzbin'] = int(NEWZBIN)
    new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME
    new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD

    new_config['Bin-Req'] = {}
    new_config['Bin-Req']['binreq'] = int(BINREQ)

    new_config['Womble'] = {}
    new_config['Womble']['womble'] = int(WOMBLE)

    new_config['SABnzbd'] = {}
    new_config['SABnzbd']['sab_username'] = SAB_USERNAME
    new_config['SABnzbd']['sab_password'] = SAB_PASSWORD
    new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY
    new_config['SABnzbd']['sab_category'] = SAB_CATEGORY
    new_config['SABnzbd']['sab_host'] = SAB_HOST

    new_config['XBMC'] = {}
    new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH)
    new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD)
    new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY)
    new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL)
    new_config['XBMC']['xbmc_host'] = XBMC_HOST
#.........这里部分代码省略.........
开发者ID:wdudokvanheel,项目名称:Sick-Beard,代码行数:101,代码来源:__init__.py


示例14: save_config

def save_config():

    new_config = ConfigObj()
    new_config.filename = CONFIG_FILE

    new_config["General"] = {}
    new_config["General"]["log_dir"] = LOG_DIR
    new_config["General"]["web_port"] = WEB_PORT
    new_config["General"]["web_host"] = WEB_HOST
    new_config["General"]["web_ipv6"] = int(WEB_IPV6)
    new_config["General"]["web_log"] = int(WEB_LOG)
    new_config["General"]["web_root"] = WEB_ROOT
    new_config["General"]["web_username"] = WEB_USERNAME
    new_config["General"]["web_password"] = WEB_PASSWORD
    new_config["General"]["use_api"] = int(USE_API)
    new_config["General"]["api_key"] = API_KEY
    new_config["General"]["use_nzbs"] = int(USE_NZBS)
    new_config["General"]["use_torrents"] = int(USE_TORRENTS)
    new_config["General"]["nzb_method"] = NZB_METHOD
    new_config["General"]["usenet_retention"] = int(USENET_RETENTION)
    new_config["General"]["search_frequency"] = int(SEARCH_FREQUENCY)
    new_config["General"]["download_propers"] = int(DOWNLOAD_PROPERS)
    new_config["General"]["quality_default"] = int(QUALITY_DEFAULT)
    new_config["General"]["status_default"] = int(STATUS_DEFAULT)
    new_config["General"]["season_folders_format"] = SEASON_FOLDERS_FORMAT
    new_config["General"]["season_folders_default"] = int(SEASON_FOLDERS_DEFAULT)
    new_config["General"]["provider_order"] = " ".join([x.getID() for x in providers.sortedProviderList()])
    new_config["General"]["version_notify"] = int(VERSION_NOTIFY)
    new_config["General"]["naming_ep_name"] = int(NAMING_EP_NAME)
    new_config["General"]["naming_show_name"] = int(NAMING_SHOW_NAME)
    new_config["General"]["naming_ep_type"] = int(NAMING_EP_TYPE)
    new_config["General"]["naming_multi_ep_type"] = int(NAMING_MULTI_EP_TYPE)
    new_config["General"]["naming_sep_type"] = int(NAMING_SEP_TYPE)
    new_config["General"]["naming_use_periods"] = int(NAMING_USE_PERIODS)
    new_config["General"]["naming_quality"] = int(NAMING_QUALITY)
    new_config["General"]["naming_dates"] = int(NAMING_DATES)
    new_config["General"]["launch_browser"] = int(LAUNCH_BROWSER)

    new_config["General"]["use_banner"] = int(USE_BANNER)
    new_config["General"]["use_listview"] = int(USE_LISTVIEW)
    new_config["General"]["metadata_xbmc"] = metadata_provider_dict["XBMC"].get_config()
    new_config["General"]["metadata_mediabrowser"] = metadata_provider_dict["MediaBrowser"].get_config()
    new_config["General"]["metadata_ps3"] = metadata_provider_dict["Sony PS3"].get_config()
    new_config["General"]["metadata_wdtv"] = metadata_provider_dict["WDTV"].get_config()
    new_config["General"]["metadata_tivo"] = metadata_provider_dict["TIVO"].get_config()

    new_config["General"]["cache_dir"] = ACTUAL_CACHE_DIR if ACTUAL_CACHE_DIR else "cache"
    new_config["General"]["root_dirs"] = ROOT_DIRS if ROOT_DIRS else ""
    new_config["General"]["tv_download_dir"] = TV_DOWNLOAD_DIR
    new_config["General"]["keep_processed_dir"] = int(KEEP_PROCESSED_DIR)
    new_config["General"]["move_associated_files"] = int(MOVE_ASSOCIATED_FILES)
    new_config["General"]["process_automatically"] = int(PROCESS_AUTOMATICALLY)
    new_config["General"]["rename_episodes"] = int(RENAME_EPISODES)

    new_config["General"]["extra_scripts"] = "|".join(EXTRA_SCRIPTS)
    new_config["General"]["git_path"] = GIT_PATH
    new_config["General"]["ignore_words"] = IGNORE_WORDS

    new_config["Blackhole"] = {}
    new_config["Blackhole"]["nzb_dir"] = NZB_DIR
    new_config["Blackhole"]["torrent_dir"] = TORRENT_DIR

    new_config["EZRSS"] = {}
    new_config["EZRSS"]["ezrss"] = int(EZRSS)

    new_config["TVTORRENTS"] = {}
    new_config["TVTORRENTS"]["tvtorrents"] = int(TVTORRENTS)
    new_config["TVTORRENTS"]["tvtorrents_digest"] = TVTORRENTS_DIGEST
    new_config["TVTORRENTS"]["tvtorrents_hash"] = TVTORRENTS_HASH

    new_config["NZBs"] = {}
    new_config["NZBs"]["nzbs"] = int(NZBS)
    new_config["NZBs"]["nzbs_uid"] = NZBS_UID
    new_config["NZBs"]["nzbs_hash"] = NZBS_HASH

    new_config["NZBsRUS"] = {}
    new_config["NZBsRUS"]["nzbsrus"] = int(NZBSRUS)
    new_config["NZBsRUS"]["nzbsrus_uid"] = NZBSRUS_UID
    new_config["NZBsRUS"]["nzbsrus_hash"] = NZBSRUS_HASH

    new_config["NZBMatrix"] = {}
    new_config["NZBMatrix"]["nzbmatrix"] = int(NZBMATRIX)
    new_config["NZBMatrix"]["nzbmatrix_username"] = NZBMATRIX_USERNAME
    new_config["NZBMatrix"]["nzbmatrix_apikey"] = NZBMATRIX_APIKEY

    new_config["Newzbin"] = {}
    new_config["Newzbin"]["newzbin"] = int(NEWZBIN)
    new_config["Newzbin"]["newzbin_username"] = NEWZBIN_USERNAME
    new_config["Newzbin"]["newzbin_password"] = NEWZBIN_PASSWORD

    new_config["Womble"] = {}
    new_config["Womble"]["womble"] = int(WOMBLE)

    new_config["SABnzbd"] = {}
    new_config["SABnzbd"]["sab_username"] = SAB_USERNAME
    new_config["SABnzbd"]["sab_password"] = SAB_PASSWORD
    new_config["SABnzbd"]["sab_apikey"] = SAB_APIKEY
    new_config["SABnzbd"]["sab_category"] = SAB_CATEGORY
    new_config["SABnzbd"]["sab_host"] = SAB_HOST

#.........这里部分代码省略.........
开发者ID:gordonturner,项目名称:Sick-Beard,代码行数:101,代码来源:__init__.py


示例15: save_config

def save_config():
        
    CFG['General']['log_dir'] = LOG_DIR
    CFG['General']['web_port'] = WEB_PORT
    CFG['General']['web_host'] = WEB_HOST
    CFG['General']['web_log'] = int(WEB_LOG)
    CFG['General']['web_root'] = WEB_ROOT
    CFG['General']['web_username'] = WEB_USERNAME
    CFG['General']['web_password'] = WEB_PASSWORD
    CFG['General']['nzb_method'] = NZB_METHOD
    CFG['General']['usenet_retention'] = int(USENET_RETENTION)
    CFG['General']['search_frequency'] = int(SEARCH_FREQUENCY)
    CFG['General']['backlog_search_frequency'] = int(BACKLOG_SEARCH_FREQUENCY)
    CFG['General']['use_nzb'] = int(USE_NZB)
    CFG['General']['quality_default'] = int(QUALITY_DEFAULT)
    CFG['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT)
    CFG['General']['provider_order'] = ' '.join([x.getID() for x in providers.sortedProviderList()])
    CFG['General']['version_notify'] = int(VERSION_NOTIFY)
    CFG['General']['naming_ep_name'] = int(NAMING_EP_NAME)
    CFG['General']['naming_show_name'] = int(NAMING_SHOW_NAME)
    CFG['General']['naming_ep_type'] = int(NAMING_EP_TYPE)
    CFG['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE)
    CFG['General']['naming_sep_type'] = int(NAMING_SEP_TYPE)
    CFG['General']['naming_use_periods'] = int(NAMING_USE_PERIODS)
    CFG['General']['naming_quality'] = int(NAMING_QUALITY)
    CFG['General']['naming_dates'] = int(NAMING_DATES)
    CFG['General']['use_torrent'] = int(USE_TORRENT)
    CFG['General']['launch_browser'] = int(LAUNCH_BROWSER)
    CFG['General']['create_metadata'] = int(CREATE_METADATA)
    CFG['General']['create_images'] = int(CREATE_IMAGES)
    CFG['General']['cache_dir'] = CACHE_DIR
    CFG['General']['tv_download_dir'] = TV_DOWNLOAD_DIR
    CFG['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR)
    CFG['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY)
    CFG['General']['rename_episodes'] = int(RENAME_EPISODES)
    CFG['Blackhole']['nzb_dir'] = NZB_DIR
    CFG['Blackhole']['torrent_dir'] = TORRENT_DIR
    CFG['TVBinz']['tvbinz'] = int(TVBINZ)
    CFG['TVBinz']['tvbinz_uid'] = TVBINZ_UID
    CFG['TVBinz']['tvbinz_sabuid'] = TVBINZ_SABUID
    CFG['TVBinz']['tvbinz_hash'] = TVBINZ_HASH
    CFG['TVBinz']['tvbinz_auth'] = TVBINZ_AUTH
    CFG['NZBs']['nzbs'] = int(NZBS)
    CFG['NZBs']['nzbs_uid'] = NZBS_UID
    CFG['NZBs']['nzbs_hash'] = NZBS_HASH
    CFG['NZBsRUS']['nzbsrus'] = int(NZBSRUS)
    CFG['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID
    CFG['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH
    CFG['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX)
    CFG['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME
    CFG['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY
    CFG['Bin-Req']['binreq'] = int(BINREQ)
    CFG['SABnzbd']['sab_username'] = SAB_USERNAME
    CFG['SABnzbd']['sab_password'] = SAB_PASSWORD
    CFG['SABnzbd']['sab_apikey'] = SAB_APIKEY
    CFG['SABnzbd']['sab_category'] = SAB_CATEGORY
    CFG['SABnzbd']['sab_host'] = SAB_HOST
    CFG['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH)
    CFG['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD)
    CFG['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY)
    CFG['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL)
    CFG['XBMC']['xbmc_host'] = XBMC_HOST
    CFG['XBMC']['xbmc_username'] = XBMC_USERNAME
    CFG['XBMC']['xbmc_password'] = XBMC_PASSWORD
    CFG['Growl']['use_growl'] = int(USE_GROWL)
    CFG['Growl']['growl_host'] = GROWL_HOST
    CFG['Growl']['growl_password'] = GROWL_PASSWORD
    
    CFG['Newznab']['newznab_data'] = '!!!'.join([x.configStr() for x in newznabProviderList])
    
    CFG.write()
开发者ID:Orbi,项目名称:Sick-Beard,代码行数:71,代码来源:__init__.py


示例16: __init__

    def __init__(self, force=None, show=None):

        #TODOif not sickbeard.DOWNLOAD_FRENCH:
        #    return
        if sickbeard.showList==None:
            return
        logger.log(u"Beginning the search for french episodes older than "+ str(sickbeard.FRENCH_DELAY) +" days")
       
        frenchlist=[]
        #get list of english episodes that we want to search in french
        myDB = db.DBConnection()
        today = datetime.date.today().toordinal()
        if show:
            frenchsql=myDB.select("SELECT showid, season, episode from tv_episodes where audio_langs='en' and tv_episodes.showid =? and (? - tv_episodes.airdate) > ? order by showid, airdate asc",[show,today,sickbeard.FRENCH_DELAY]) 
            count=myDB.select("SELECT count(*) from tv_episodes where audio_langs='en' and tv_episodes.showid =? and (? - tv_episodes.airdate) > ?",[show,today,sickbeard.FRENCH_DELAY]) 
        else:
            frenchsql=myDB.select("SELECT showid, season, episode from tv_episodes, tv_shows where audio_langs='en' and tv_episodes.showid = tv_shows.tvdb_id and tv_shows.frenchsearch = 1 and (? - tv_episodes.airdate) > ? order by showid, airdate asc",[today,sickbeard.FRENCH_DELAY])
            count=myDB.select("SELECT count(*) from tv_episodes, tv_shows where audio_langs='en' and tv_episodes.showid = tv_shows.tvdb_id and tv_shows.frenchsearch = 1 and (? - tv_episodes.airdate) > ?",[today,sickbeard.FRENCH_DELAY])
        #make the episodes objects
        logger.log(u"Searching for "+str(count[0][0]) +" episodes in french")
        for episode in frenchsql:
            showObj = helpers.findCertainShow(sickbeard.showList, episode[0])
            epObj = showObj.getEpisode(episode[1], episode[2])
            frenchlist.append(epObj)
        
        #for each episode in frenchlist fire a search in french
        delay=[]
        for frepisode in frenchlist:
            if frepisode.show.tvdbid in delay:
                logger.log(u"Previous episode for show "+str(frepisode.show.tvdbid)+" not found in french so skipping this search", logger.DEBUG)
                continue
            result=[]
            for curProvider in providers.sortedProviderList():

                if not curProvider.isActive():
                    continue

                logger.log(u"Searching for french episodes on "+curProvider.name +" for " +frepisode.show.name +" season "+str(frepisode.season)+" episode "+str(frepisode.episode))
                try:
                    curfrench = curProvider.findFrench(frepisode, manualSearch=True)
                except:
                    logger.log(u"Exception", logger.DEBUG)
                    pass
                test=0
                if curfrench:
                    for x in curfrench:
                        if not show_name_helpers.filterBadReleases(x.name):
                            logger.log(u"French "+x.name+" isn't a valid scene release that we want, ignoring it", logger.DEBUG)
                            test+=1
                            continue
                        if sickbeard.IGNORE_WORDS == "":
                            ignore_words="ztreyfgut"
                        else:
                            ignore_words=str(sickbeard.IGNORE_WORDS)
                        for fil in resultFilters + ignore_words.split(','):
                            if fil == showLanguages.get(u"fr"):
                                continue
                            if re.search('(^|[\W_])'+fil+'($|[\W_])', x.url, re.I):
                                logger.log(u"Invalid scene release: "+x.url+" contains "+fil+", ignoring it", logger.DEBUG)
                                test+=1
                    if test==0:
                        result.append(x)
            best=None
            try:
                epi={}
                epi[1]=frepisode
                best = search.pickBestResult(result, episode = epi)
            except:
                pass
            if best:
                best.name=best.name + ' snatchedfr'
                logger.log(u"Found french episode for " +frepisode.show.name +" season "+str(frepisode.season)+" episode "+str(frepisode.episode))
                try:
                    search.snatchEpisode(best, SNATCHED_FRENCH)
                except:
                    logger.log(u"Exception", logger.DEBUG)
                    pass
            else:
                delay.append(frepisode.show.tvdbid)
                logger.log(u"No french episodes found for " +frepisode.show.name +" season "+str(frepisode.season)+" episode "+str(frepisode.episode))
开发者ID:Breizhek,项目名称:Sick-Beard,代码行数:80,代码来源:frenchFinder.py


示例17: save_config

def save_config():

    new_config = ConfigObj()
    new_config.filename = sickbeard.CONFIG_FILE

    new_config['General'] = {}
    new_config['General']['log_dir'] = LOG_DIR
    new_config['General']['web_port'] = WEB_PORT
    new_config['General']['web_host'] = WEB_HOST
    new_config['General']['web_ipv6'] = WEB_IPV6
    new_config['General']['web_log'] = int(WEB_LOG)
    new_config['General']['web_root'] = WEB_ROOT
    new_config['General']['web_username'] = WEB_USERNAME
    new_config['General']['web_password'] = WEB_PASSWORD
    new_config['General']['nzb_method'] = NZB_METHOD
    new_config['General']['usenet_retention'] = int(USENET_RETENTION)
    new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY)
    new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS)
    new_config['General']['quality_default'] = int(QUALITY_DEFAULT)
    new_config['General']['season_folders_format'] = SEASON_FOLDERS_FORMAT
    new_config['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT)
    new_config['General']['provider_order'] = ' '.join([x.getID() for x in providers.sortedProviderList()])
    new_config['General']['version_notify'] = int(VERSION_NOTIFY)
    new_config['General']['naming_ep_name'] = int(NAMING_EP_NAME)
    new_config['General']['naming_show_name'] = int(NAMING_SHOW_NAME)
    new_config['General']['naming_ep_type'] = int(NAMING_EP_TYPE)
    new_config['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE)
    new_config['General']['naming_sep_type'] = int(NAMING_SEP_TYPE)
    new_config['General']['naming_use_periods'] = int(NAMING_USE_PERIODS)
    new_config['General']['naming_quality'] = int(NAMING_QUALITY)
    new_config['General']['naming_dates'] = int(NAMING_DATES)
    new_config['General']['launch_browser'] = int(LAUNCH_BROWSER)

    new_config['General']['use_banner'] = int(USE_BANNER)
    new_config['General']['use_listview'] = int(USE_LISTVIEW)
    new_config['General']['metadata_xbmc'] = metadata_provider_dict['XBMC'].get_config()
    new_config['General']['metadata_mediabrowser'] = metadata_provider_dict['MediaBrowser'].get_config()
    new_config['General']['metadata_ps3'] = metadata_provider_dict['Sony PS3'].get_config()

    new_config['General']['cache_dir'] = CACHE_DIR if CACHE_DIR else 'cache'
    new_config['General']['tv_download_dir'] = TV_DOWNLOAD_DIR
    new_config['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR)
    new_config['General']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES)
    new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY)
    new_config['General']['rename_episodes'] = int(RENAME_EPISODES)
    
    new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS)
    new_config['General']['git_path'] = GIT_PATH

    new_config['Blackhole'] = {}
    new_config['Blackhole']['nzb_dir'] = NZB_DIR
    new_config['Blackhole']['torrent_dir'] = TORRENT_DIR

    new_config['EZRSS'] = {}
    new_config['EZRSS']['ezrss'] = int(EZRSS)

    new_config['TVBinz'] = {}
    new_config['TVBinz']['tvbinz'] = int(TVBINZ)
    new_config['TVBinz']['tvbinz_uid'] = TVBINZ_UID
    new_config['TVBinz']['tvbinz_hash'] = TVBINZ_HASH
    new_config['TVBinz']['tvbinz_auth'] = TVBINZ_AUTH

    new_config['NZBs'] = {}
    new_config['NZBs']['nzbs'] = int(NZBS)
    new_config['NZBs']['nzbs_uid'] = NZBS_UID
    new_config['NZBs']['nzbs_hash'] = NZBS_HASH

    new_config['NZBsRUS'] = {}
    new_config['NZBsRUS']['nzbsrus'] = int(NZBSRUS)
    new_config['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID
    new_config['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH

    new_config['NZBMatrix'] = {}
    new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX)
    new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME
    new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY

    new_config['Newzbin'] = {}
    new_config['Newzbin']['newzbin'] = int(NEWZBIN)
    new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME
    new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD

    new_config['Bin-Req'] = {}
    new_config['Bin-Req']['binreq'] = int(BINREQ)

    new_config['Womble'] = {}
    new_config['Womble']['womble'] = int(WOMBLE)

    new_config['SABnzbd'] = {}
    new_config['SABnzbd']['sab_username'] = SAB_USERNAME
    new_config['SABnzbd']['sab_password'] = SAB_PASSWORD
    new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY
    new_config['SABnzbd']['sab_category'] = SAB_CATEGORY
    new_config['SABnzbd']['sab_host'] = SAB_HOST

    new_config['XBMC'] = {}
    new_config['XBMC']['use_xbmc'] = int(USE_XBMC)    
    new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH)
    new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD) 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python sab.sendNZB函数代码示例发布时间:2022-05-27
下一篇:
Python providers.makeProviderList函数代码示例发布时间: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