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

Python common.Quality类代码示例

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

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



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

示例1: test_logSnatch

    def test_logSnatch(self):
        myDB = db.DBConnection("../sickbeard.db")
        #res = myDB.select("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;")
        
        #for r in res:
            #print r["name"]
        
        #print "tables-----------------------"
        searchResult=SearchResults([Episode(12345,2,4),Episode(54321,1,3)])
        history.logSnatch(searchResult)
        
        #check if elements added
        res=myDB.select("SELECT COUNT(*) FROM history WHERE (action=? AND date=? AND showid=? AND season=? AND episode=? AND quality=? AND resource=? AND provider=?)",
                [Quality.compositeStatus(SNATCHED, 4), datetime.datetime.today().strftime(dateFormat), 12345, 2, 4, 4, "searchName", "unknown"])

        self.assertEqual(len(res),1)
        res=myDB.select("SELECT COUNT(*) FROM history WHERE (action=? AND date=? AND showid=? AND season=? AND episode=? AND quality=? AND resource=? AND provider=?)",
                [Quality.compositeStatus(SNATCHED, 4), datetime.datetime.today().strftime(dateFormat), 54321, 1, 3, 4, "searchName", "unknown"])

        self.assertEqual(len(res),1)
        
        #delete just-added elements
        myDB.action("DELETE FROM history WHERE (action=? AND date=? AND showid=? AND season=? AND episode=? AND quality=? AND resource=? AND provider=?)",
                [Quality.compositeStatus(SNATCHED, 4), datetime.datetime.today().strftime(dateFormat), 12345, 2, 4, 4, "searchName", "unknown"])
        myDB.action("DELETE FROM history WHERE (action=? AND date=? AND showid=? AND season=? AND episode=? AND quality=? AND resource=? AND provider=?)",
                [Quality.compositeStatus(SNATCHED, 4), datetime.datetime.today().strftime(dateFormat), 54321, 1, 3, 4, "searchName", "unknown"])
开发者ID:natem345,项目名称:Sick-Beard,代码行数:26,代码来源:history_tests.py


示例2: _find_season_quality

    def _find_season_quality(self, title, torrent_id, ep_number):
        """ Return the modified title of a Season Torrent with the quality found inspecting torrent file list """

        mediaExtensions = ['avi', 'mkv', 'wmv', 'divx',
                           'vob', 'dvr-ms', 'wtv', 'ts'
                                                   'ogv', 'rar', 'zip', 'mp4']

        quality = Quality.UNKNOWN

        fileName = None

        fileURL = self.proxy._buildURL(self.url + 'ajax_details_filelist.php?id=' + str(torrent_id))

        data = self.getURL(fileURL)
        if not data:
            return None

        filesList = re.findall('<td.+>(.*?)</td>', data)

        if not filesList:
            logger.log(u"Unable to get the torrent file list for " + title, logger.ERROR)

        videoFiles = filter(lambda x: x.rpartition(".")[2].lower() in mediaExtensions, filesList)

        #Filtering SingleEpisode/MultiSeason Torrent
        if len(videoFiles) < ep_number or len(videoFiles) > float(ep_number * 1.1):
            logger.log(
                u"Result " + title + " have " + str(ep_number) + " episode and episodes retrived in torrent are " + str(
                    len(videoFiles)), logger.DEBUG)
            logger.log(u"Result " + title + " Seem to be a Single Episode or MultiSeason torrent, skipping result...",
                       logger.DEBUG)
            return None

        if Quality.sceneQuality(title) != Quality.UNKNOWN:
            return title

        for fileName in videoFiles:
            quality = Quality.sceneQuality(os.path.basename(fileName))
            if quality != Quality.UNKNOWN: break

        if fileName is not None and quality == Quality.UNKNOWN:
            quality = Quality.assumeQuality(os.path.basename(fileName))

        if quality == Quality.UNKNOWN:
            logger.log(u"Unable to obtain a Season Quality for " + title, logger.DEBUG)
            return None

        try:
            myParser = NameParser()
            parse_result = myParser.parse(fileName)
        except InvalidNameException:
            return None

        logger.log(u"Season quality for " + title + " is " + Quality.qualityStrings[quality], logger.DEBUG)

        if parse_result.series_name and parse_result.season_number:
            title = parse_result.series_name + ' S%02d' % int(parse_result.season_number) + ' ' + self._reverseQuality(
                quality)

        return title
开发者ID:sgtwtf,项目名称:SickRage,代码行数:60,代码来源:thepiratebay.py


示例3: history_snatched_proper_fix

def history_snatched_proper_fix():
    my_db = db.DBConnection()
    if not my_db.has_flag('history_snatch_proper'):
        logger.log('Updating history items with status Snatched Proper in a background process...')
        sql_result = my_db.select('SELECT rowid, resource, quality, showid'
                                  ' FROM history'
                                  ' WHERE action LIKE "%%%02d"' % SNATCHED +
                                  ' AND (UPPER(resource) LIKE "%PROPER%"'
                                  ' OR UPPER(resource) LIKE "%REPACK%"'
                                  ' OR UPPER(resource) LIKE "%REAL%")')
        if sql_result:
            cl = []
            for r in sql_result:
                show_obj = None
                try:
                    show_obj = helpers.findCertainShow(sickbeard.showList, int(r['showid']))
                except (StandardError, Exception):
                    pass
                np = NameParser(False, showObj=show_obj, testing=True)
                try:
                    pr = np.parse(r['resource'])
                except (StandardError, Exception):
                    continue
                if 0 < Quality.get_proper_level(pr.extra_info_no_name(), pr.version, pr.is_anime):
                    cl.append(['UPDATE history SET action = ? WHERE rowid = ?',
                               [Quality.compositeStatus(SNATCHED_PROPER, int(r['quality'])),
                                r['rowid']]])
            if cl:
                my_db.mass_action(cl)
            logger.log('Completed the history table update with status Snatched Proper.')
        my_db.add_flag('history_snatch_proper')
开发者ID:JackDandy,项目名称:SickGear,代码行数:31,代码来源:history.py


示例4: logSubtitle

def logSubtitle(showid, season, episode, status, subtitleResult):
    resource = subtitleResult.path
    provider = subtitleResult.service
    status, quality = Quality.splitCompositeStatus(status)
    action = Quality.compositeStatus(SUBTITLED, quality)

    _logHistoryItem(action, showid, season, episode, quality, resource, provider)
开发者ID:jbwdevos,项目名称:SickRage,代码行数:7,代码来源:history.py


示例5: _find_season_quality

    def _find_season_quality(self, title, torrent_link, ep_number):
        """ Return the modified title of a Season Torrent with the quality found inspecting torrent file list """

        quality = Quality.UNKNOWN

        file_name = None

        data = self.get_url(torrent_link)
        if not data:
            return None

        try:
            with BS4Parser(data, features=['html5lib', 'permissive']) as soup:
                file_table = soup.find('table', attrs={'class': 'torrentFileList'})

                if not file_table:
                    return None

                files = [x.text for x in file_table.find_all('td', attrs={'class': 'torFileName'})]
                video_files = filter(lambda i: i.rpartition('.')[2].lower() in mediaExtensions, files)

                # Filtering SingleEpisode/MultiSeason Torrent
                if len(video_files) < ep_number or len(video_files) > float(ep_number * 1.1):
                    logger.log(u'Result %s lists %s episodes with %s episodes retrieved in torrent'
                               % (title, ep_number, len(video_files)), logger.DEBUG)
                    logger.log(u'Result %s seem to be a single episode or multi-season torrent, skipping result...'
                               % title, logger.DEBUG)
                    return None

                if Quality.UNKNOWN != Quality.sceneQuality(title):
                    return title

                for file_name in video_files:
                    quality = Quality.sceneQuality(os.path.basename(file_name))
                    if Quality.UNKNOWN != quality:
                        break

                if None is not file_name and Quality.UNKNOWN == quality:
                    quality = Quality.assumeQuality(os.path.basename(file_name))

                if Quality.UNKNOWN == quality:
                    logger.log(u'Unable to obtain a Season Quality for ' + title, logger.DEBUG)
                    return None

                try:
                    my_parser = NameParser(showObj=self.show)
                    parse_result = my_parser.parse(file_name)
                except (InvalidNameException, InvalidShowException):
                    return None

                logger.log(u'Season quality for %s is %s' % (title, Quality.qualityStrings[quality]), logger.DEBUG)

                if parse_result.series_name and parse_result.season_number:
                    title = parse_result.series_name + ' S%02d %s' % (int(parse_result.season_number),
                                                                      self._reverse_quality(quality))
                return title

        except Exception:
            logger.log(u'Failed to quality parse ' + self.name + ' Traceback: ' + traceback.format_exc(), logger.ERROR)
开发者ID:Apocrathia,项目名称:SickGear,代码行数:59,代码来源:kat.py


示例6: logFailed

def logFailed(epObj, release, provider=None):
    showid = int(epObj.show.indexerid)
    season = int(epObj.season)
    epNum = int(epObj.episode)
    status, quality = Quality.splitCompositeStatus(epObj.status)
    action = Quality.compositeStatus(FAILED, quality)

    _logHistoryItem(action, showid, season, epNum, quality, release, provider)
开发者ID:jbwdevos,项目名称:SickRage,代码行数:8,代码来源:history.py


示例7: _find_season_quality

    def _find_season_quality(self,title, torrent_link, ep_number):
        """ Return the modified title of a Season Torrent with the quality found inspecting torrent file list """

        mediaExtensions = ['avi', 'mkv', 'wmv', 'divx',
                           'vob', 'dvr-ms', 'wtv', 'ts'
                           'ogv', 'rar', 'zip', 'mp4'] 
        
        quality = Quality.UNKNOWN        
        
        fileName = None

        data = self.getURL(torrent_link)
        
        if not data:
            return None
        
        try: 
            soup = BeautifulSoup(data, features=["html5lib", "permissive"])
            file_table = soup.find('table', attrs = {'class': 'torrentFileList'})

            if not file_table:
                return None
            
            files = [x.text for x in file_table.find_all('td', attrs = {'class' : 'torFileName'} )]
            videoFiles = filter(lambda x: x.rpartition(".")[2].lower() in mediaExtensions, files)

            #Filtering SingleEpisode/MultiSeason Torrent
            if len(videoFiles) < ep_number or len(videoFiles) > float(ep_number * 1.1 ):
                logger.log(u"Result " + title + " Seem to be a Single Episode or MultiSeason torrent, skipping result...", logger.DEBUG)
                return None

            for fileName in videoFiles:
                quality = Quality.sceneQuality(os.path.basename(fileName))
                if quality != Quality.UNKNOWN: break
    
            if fileName!=None and quality == Quality.UNKNOWN:
                quality = Quality.assumeQuality(os.path.basename(fileName))            
    
            if quality == Quality.UNKNOWN:
                logger.log(u"Unable to obtain a Season Quality for " + title, logger.DEBUG)
                return None
    
            try:
                myParser = NameParser()
                parse_result = myParser.parse(fileName)
            except InvalidNameException:
                return None
            
            logger.log(u"Season quality for "+title+" is "+Quality.qualityStrings[quality], logger.DEBUG)
            
            if parse_result.series_name and parse_result.season_number: 
                title = parse_result.series_name+' S%02d' % int(parse_result.season_number)+' '+self._reverseQuality(quality)
            
            return title
            
        except Exception, e:
            logger.log(u"Failed parsing " + self.name + " Traceback: "  + traceback.format_exc(), logger.ERROR)
开发者ID:fldc,项目名称:Sick-Beard,代码行数:57,代码来源:kat.py


示例8: logFailed

def logFailed(tvdbid, season, episode, status, release, provider=None):

    showid = int(tvdbid)
    season = int(season)
    epNum = int(episode)
    status, quality = Quality.splitCompositeStatus(status)
    action = Quality.compositeStatus(FAILED, quality)

    _logHistoryItem(action, showid, season, epNum, quality, release, provider)
开发者ID:vertigo235,项目名称:Sick-Beard-XEM,代码行数:9,代码来源:history.py


示例9: _find_season_quality

    def _find_season_quality(self, title, torrent_id, ep_number):
        """ Return the modified title of a Season Torrent with the quality found inspecting torrent file list """

        if not self.url:
            return False

        quality = Quality.UNKNOWN
        file_name = None
        data = self.get_url('%sajax_details_filelist.php?id=%s' % (self.url, torrent_id))
        if self.should_skip() or not data:
            return None

        files_list = re.findall('<td.+>(.*?)</td>', data)

        if not files_list:
            logger.log(u'Unable to get the torrent file list for ' + title, logger.ERROR)

        video_files = filter(lambda x: x.rpartition('.')[2].lower() in mediaExtensions, files_list)

        # Filtering SingleEpisode/MultiSeason Torrent
        if ep_number > len(video_files) or float(ep_number * 1.1) < len(video_files):
            logger.log(u'Result %s has episode %s and total episodes retrieved in torrent are %s'
                       % (title, str(ep_number), str(len(video_files))), logger.DEBUG)
            logger.log(u'Result %s seems to be a single episode or multiseason torrent, skipping result...'
                       % title, logger.DEBUG)
            return None

        if Quality.UNKNOWN != Quality.sceneQuality(title):
            return title

        for file_name in video_files:
            quality = Quality.sceneQuality(os.path.basename(file_name))
            if Quality.UNKNOWN != quality:
                break

        if None is not file_name and Quality.UNKNOWN == quality:
            quality = Quality.assumeQuality(os.path.basename(file_name))

        if Quality.UNKNOWN == quality:
            logger.log(u'Unable to obtain a Season Quality for ' + title, logger.DEBUG)
            return None

        try:
            my_parser = NameParser(showObj=self.show, indexer_lookup=False)
            parse_result = my_parser.parse(file_name)
        except (InvalidNameException, InvalidShowException):
            return None

        logger.log(u'Season quality for %s is %s' % (title, Quality.qualityStrings[quality]), logger.DEBUG)

        if parse_result.series_name and parse_result.season_number:
            title = '%s S%02d %s' % (parse_result.series_name,
                                     int(parse_result.season_number),
                                     self._reverse_quality(quality))

        return title
开发者ID:JackDandy,项目名称:SickGear,代码行数:56,代码来源:thepiratebay.py


示例10: _find_season_quality

    def _find_season_quality(self, title, torrent_id):
        """ Rewrite the title of a Season Torrent with the quality found inspecting torrent file list """

        mediaExtensions = ["avi", "mkv", "wmv", "divx", "vob", "dvr-ms", "wtv", "ts" "ogv", "rar", "zip"]

        quality = Quality.UNKNOWN

        fileName = None

        fileURL = self.proxy._buildURL(self.url + "ajax_details_filelist.php?id=" + str(torrent_id))

        data = self.getURL(fileURL)

        if not data:
            return None

        filesList = re.findall("<td.+>(.*?)</td>", data)

        if not filesList:
            logger.log(u"Unable to get the torrent file list for " + title, logger.ERROR)

        #        for fileName in filter(lambda x: x.rpartition(".")[2].lower() in mediaExtensions, filesList):
        #            quality = Quality.nameQuality(os.path.basename(fileName))
        #            if quality != Quality.UNKNOWN: break

        for fileName in filesList:
            sepFile = fileName.rpartition(".")
            if fileName.rpartition(".")[2].lower() in mediaExtensions:
                quality = Quality.nameQuality(fileName)
                if quality != Quality.UNKNOWN:
                    break

        if fileName != None and quality == Quality.UNKNOWN:
            quality = Quality.assumeQuality(os.path.basename(fileName))

        if quality == Quality.UNKNOWN:
            logger.log(u"No Season quality for " + title, logger.DEBUG)
            return None

        try:
            myParser = NameParser()
            parse_result = myParser.parse(fileName)
        except InvalidNameException:
            return None

        logger.log(u"Season quality for " + title + " is " + Quality.qualityStrings[quality], logger.DEBUG)

        if parse_result.series_name and parse_result.season_number:
            title = (
                parse_result.series_name
                + " S%02d" % int(parse_result.season_number)
                + " "
                + self._reverseQuality(quality)
            )

        return title
开发者ID:majello,项目名称:Sick-Beard-Majello,代码行数:56,代码来源:thepiratebay.py


示例11: set_episode_failed

def set_episode_failed(ep_obj):

    try:
        with ep_obj.lock:
            quality = Quality.splitCompositeStatus(ep_obj.status)[1]
            ep_obj.status = Quality.compositeStatus(FAILED, quality)
            ep_obj.saveToDB()

    except EpisodeNotFoundException as e:
        logger.log('Unable to get episode, please set its status manually: %s' % ex(e), logger.WARNING)
开发者ID:JackDandy,项目名称:SickGear,代码行数:10,代码来源:failed_history.py


示例12: markFailed

def markFailed(epObj):
    log_str = u""

    try:
        with epObj.lock:
            quality = Quality.splitCompositeStatus(epObj.status)[1]
            epObj.status = Quality.compositeStatus(FAILED, quality)
            epObj.saveToDB()

    except EpisodeNotFoundException, e:
        logger.log(u"Unable to get episode, please set its status manually: " + ex(e), logger.WARNING)
开发者ID:Cliff1980,项目名称:SickRage,代码行数:11,代码来源:failed_history.py


示例13: getQuality

 def getQuality(self, item, anime=False):
     if 'quality' in item:
         if item.get('quality') == "480p":
             return Quality.SDTV
         elif item.get('quality') == "720p":
             return Quality.HDWEBDL
         elif item.get('quality') == "1080p":
             return Quality.FULLHDWEBDL
         else:
             return Quality.sceneQuality(item.get('title'), anime)
     else:
         return Quality.sceneQuality(item.get('title'), anime)
开发者ID:abetancort,项目名称:SickRage,代码行数:12,代码来源:eztv.py


示例14: markFailed

def markFailed(show_obj, season, episode=None):
    log_str = u""

    if episode:
        try:
            ep_obj = show_obj.getEpisode(season, episode)

            with ep_obj.lock:
                quality = Quality.splitCompositeStatus(ep_obj.status)[1]
                ep_obj.status = Quality.compositeStatus(FAILED, quality)
                ep_obj.saveToDB()

        except exceptions.EpisodeNotFoundException, e:
            log_str += _log_helper(u"Unable to get episode, please set its status manually: " + exceptions.ex(e), logger.WARNING)
开发者ID:zimbo69,项目名称:Sick-Beard,代码行数:14,代码来源:failed_history.py


示例15: generate_sample_ep

def generate_sample_ep(multi=None, abd=False, sports=False, anime_type=None):
    # make a fake episode object
    ep = TVEpisode(2, 3, 3, "Ep Name")

    # pylint: disable=protected-access
    ep._status = Quality.compositeStatus(DOWNLOADED, Quality.HDTV)
    ep._airdate = datetime.date(2011, 3, 9)

    if abd:
        ep._release_name = 'Show.Name.2011.03.09.HDTV.XviD-RLSGROUP'
        ep.show.air_by_date = 1
    elif sports:
        ep._release_name = 'Show.Name.2011.03.09.HDTV.XviD-RLSGROUP'
        ep.show.sports = 1
    else:
        if anime_type != 3:
            ep.show.anime = 1
            ep._release_name = 'Show.Name.003.HDTV.XviD-RLSGROUP'
        else:
            ep._release_name = 'Show.Name.S02E03.HDTV.XviD-RLSGROUP'

    if multi is not None:
        ep._name = "Ep Name (1)"

        if anime_type != 3:
            ep.show.anime = 1

            ep._release_name = 'Show.Name.003-004.HDTV.XviD-RLSGROUP'

            secondEp = TVEpisode(2, 4, 4, "Ep Name (2)")
            secondEp._status = Quality.compositeStatus(DOWNLOADED, Quality.HDTV)
            secondEp._release_name = ep._release_name

            ep.relatedEps.append(secondEp)
        else:
            ep._release_name = 'Show.Name.S02E03E04E05.HDTV.XviD-RLSGROUP'

            secondEp = TVEpisode(2, 4, 4, "Ep Name (2)")
            secondEp._status = Quality.compositeStatus(DOWNLOADED, Quality.HDTV)
            secondEp._release_name = ep._release_name

            thirdEp = TVEpisode(2, 5, 5, "Ep Name (3)")
            thirdEp._status = Quality.compositeStatus(DOWNLOADED, Quality.HDTV)
            thirdEp._release_name = ep._release_name

            ep.relatedEps.append(secondEp)
            ep.relatedEps.append(thirdEp)

    return ep
开发者ID:ArthurGarnier,项目名称:SickRage,代码行数:49,代码来源:naming.py


示例16: logFailed

def logFailed(epObj, release, provider=None):
    """
    Log a failed download

    :param epObj: Episode object
    :param release: Release group
    :param provider: Provider used for snatch
    """
    showid = int(epObj.show.indexerid)
    season = int(epObj.season)
    epNum = int(epObj.episode)
    status, quality = Quality.splitCompositeStatus(epObj.status)
    action = Quality.compositeStatus(FAILED, quality)

    _logHistoryItem(action, showid, season, epNum, quality, release, provider)
开发者ID:repmeer,项目名称:SickRage,代码行数:15,代码来源:history.py


示例17: _parseItem

	def _parseItem(self, item):

		if item.findtext('title') != None and item.findtext('title') == "You must be logged in to view this feed":
			raise exceptions.AuthException("TVBinz authentication details are incorrect, check your config")

		if item.findtext('title') == None or item.findtext('link') == None:
			logger.log(u"The XML returned from the TVBinz RSS feed is incomplete, this result is unusable: "+str(item), logger.ERROR)
			return

		title = item.findtext('title')
		url = item.findtext('link').replace('&amp;', '&')

		sInfo = item.find('{http://tvbinz.net/rss/tvb/}seriesInfo')
		if sInfo == None:
			logger.log(u"No series info, this is some kind of non-standard release, ignoring it", logger.DEBUG)
			return

		logger.log(u"Adding item from RSS to cache: "+title, logger.DEBUG)

		quality = Quality.nameQuality(title)

		if sInfo.findtext('{http://tvbinz.net/rss/tvb/}tvrID') == None:
			tvrid = 0
		else:
			tvrid = int(sInfo.findtext('{http://tvbinz.net/rss/tvb/}tvrID'))

		# since TVBinz normalizes the scene names it's more reliable to parse the episodes out myself
		# than to rely on it, because it doesn't support multi-episode numbers in the feed
		self._addCacheEntry(title, url, tvrage_id=tvrid, quality=quality)
开发者ID:kacy,项目名称:Sick-Beard,代码行数:29,代码来源:tvbinz.py


示例18: _doSearch

    def _doSearch(self, searchString, show=None, season=None, french=None):
        if not self.login_done:
            self._doLogin(sickbeard.SOTORRENT_USERNAME, sickbeard.SOTORRENT_PASSWORD)

        results = []

        search_url = "{0}/sphinx.php?{1}".format(self.url, searchString.replace('!',''))
        req = self.opener.open(search_url)
        page = BeautifulSoup(req)

        torrent_table = page.find("table", {"id" : "torrent_list"})
        if torrent_table:
            logger.log(u"So-torrent found shows ! " , logger.DEBUG)  
            torrent_rows = torrent_table.findAll("tr", {"id" : "infos_sphinx"})

            for row in torrent_rows:
                release = row.strong.string
                id_search = row.find("img", {"alt" : "+"})
                id_torrent = id_search['id'].replace('expandoGif', '')
                download_url = "https://so-torrent.com/get.php?id={0}".format(id_search['id'].replace('expandoGif', ''))
                id_quality = Quality.nameQuality(release)

                if show and french==None:
                       results.append(SOTORRENTSearchResult(self.opener, release, download_url, id_quality, str(show.audio_lang)))
                elif show and french:
                   results.append(SOTORRENTSearchResult(self.opener, release, download_url, id_quality, 'fr'))
                else:
                    results.append(SOTORRENTSearchResult(self.opener, release, download_url, id_quality))

        else:
            logger.log(u"No table founded.", logger.DEBUG)
            self.login_done = False             
        return results
开发者ID:darkvadehors,项目名称:Sick-Beard,代码行数:33,代码来源:sotorrent.py


示例19: query

    def query(self, filepath, languages, keywords, series, season, episode):

        logger.debug(u'Getting subtitles for %s season %d episode %d with languages %r' % (series, season, episode, languages))
        self.init_cache()
        try:
            series = series.lower().replace('(','').replace(')','')
            series_id = self.get_series_id(series)
        except KeyError:
            logger.debug(u'Could not find series id for %s' % series)
            return []
        
        episode_id = self.get_episode_id(series, series_id, season, episode, Quality.nameQuality(filepath))
        if not episode_id:
            logger.debug(u'Could not find subtitle for series %s' % series)
            return []

        r = self.session.get(self.server_url + 'index.php?option=com_remository&Itemid=6&func=fileinfo&id=' + episode_id)
        soup = BeautifulSoup(r.content)

        sub_link = soup.find('div', attrs = {'id' : 'remositoryfileinfo'}).find(href=re.compile('func=download'))['href']
        sub_language = self.get_language('it')
        path = get_subtitle_path(filepath, sub_language, self.config.multi)
        subtitle = ResultSubtitle(path, sub_language, self.__class__.__name__.lower(), sub_link)
        
        return [subtitle]
开发者ID:13111,项目名称:SickRage,代码行数:25,代码来源:itasa.py


示例20: getQuality

    def getQuality(self, item):

        filename = helpers.get_xml_text(
            item.find('{http://xmlns.ezrss.it/0.1/}torrent/{http://xmlns.ezrss.it/0.1/}fileName'))
        quality = Quality.nameQuality(filename)

        return quality
开发者ID:coach0742,项目名称:SickBeard-TVRage,代码行数:7,代码来源:ezrss.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python common.XML_NSMAP类代码示例发布时间:2022-05-27
下一篇:
Python clients.getClientIstance函数代码示例发布时间: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