本文整理汇总了Python中sickbeard.common.Quality.sceneQualityFromName方法的典型用法代码示例。如果您正苦于以下问题:Python Quality.sceneQualityFromName方法的具体用法?Python Quality.sceneQualityFromName怎么用?Python Quality.sceneQualityFromName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sickbeard.common.Quality
的用法示例。
在下文中一共展示了Quality.sceneQualityFromName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_quality
# 需要导入模块: from sickbeard.common import Quality [as 别名]
# 或者: from sickbeard.common.Quality import sceneQualityFromName [as 别名]
def get_quality(self, item, anime=False):
(title, url_) = self._get_title_and_url(item)
quality = Quality.scene_quality(title, anime)
logger.log(u"Parsed quality : %s" %quality, logger.DEBUG)
height=""
logger.log(u"Check if size minimums should apply", logger.DEBUG)
if quality == Quality.FULLHDTV or quality == Quality.FULLHDWEBDL or quality == Quality.FULLHDBLURAY:
height="1080p"
elif quality == Quality.HDTV or quality == Quality.HDWEBDL or quality == Quality.HDBLURAY:
height="720p"
if height != "":
logger.log(u"Size minimums apply Height is: %s" %height, logger.DEBUG)
rlsSize = self._get_size(item)
if rlsSize > -1:
logger.log(u"Rls has size, Size: %s" %rlsSize, logger.DEBUG)
rlsCodec = Quality.sceneQualityFromName(title,quality)
if rlsCodec == "":
rlsCodec = "x264"
logger.log(u"Rls has no codec, 'x264' set as default", logger.DEBUG)
logger.log(u"Rls has codec, codec: %s" %rlsCodec, logger.DEBUG)
logger.log(u"Rls has runtime, runtime: %s" %self.show.runtime, logger.DEBUG)
if "265" in rlsCodec or rlsCodec== "hevc":
if self.show.runtime > 30:
if (height=="1080p" and rlsSize <= 400000000) or (height=="720p" and rlsSize <= 200000000):
logger.log(u"Show has runtime over 30 and is x265", logger.DEBUG)
quality = Quality.UNKNOWN
else:
if (height=="1080p" and rlsSize <= 200000000) or (height=="720p" and rlsSize <= 100000000):
logger.log(u"Show has runtime under 30 and is x265", logger.DEBUG)
quality = Quality.UNKNOWN
elif "264" in rlsCodec or rlsCodec== "avc":
if self.show.runtime > 30:
if (height=="1080p" and rlsSize <= 1000000000) or (height=="720p" and rlsSize <= 800000000):
logger.log(u"Show has runtime over 30 and is x264", logger.DEBUG)
quality = Quality.UNKNOWN
else:
if (height=="1080p" and rlsSize <= 700000000) or (height=="720p" and rlsSize <= 500000000):
logger.log(u"Show has runtime under 30 and is x264", logger.DEBUG)
quality = Quality.UNKNOWN
logger.log(u"Quality set to: %s" %quality, logger.DEBUG)
return quality
示例2: getQuality
# 需要导入模块: from sickbeard.common import Quality [as 别名]
# 或者: from sickbeard.common.Quality import sceneQualityFromName [as 别名]
def getQuality(self, item, anime=False):
"""
Figures out the quality of the given RSS item node
item: An elementtree.ElementTree element representing the <item> tag of the RSS feed
Returns a Quality value obtained from the node's data
"""
(title, url) = self._get_title_and_url(item)
quality = Quality.sceneQuality(title, anime)
height=""
if quality == Quality.FULLHDTV or quality == Quality.FULLHDWEBDL or quality == Quality.FULLHDBLURAY:
height="1080p"
elif quality == Quality.HDTV or quality == Quality.HDWEBDL or quality == Quality.HDBLURAY:
height="720p"
if height != "":
rlsSize = self._get_size(item)
if rlsSize > -1:
rlsCodec = Quality.sceneQualityFromName(title,quality)
if rlsCodec == "":
rlsCodec = "x264"
if "265" in rlsCodec or rlsCodec== "hevc":
if self.show.runtime > 30:
if (height=="1080p" and rlsSize <= 400000000) or (height=="720p" and rlsSize <= 200000000):
quality = Quality.UNKNOWN
else:
if (height=="1080p" and rlsSize <= 200000000) or (height=="720p" and rlsSize <= 100000000):
quality = Quality.UNKNOWN
elif "264" in rlsCodec or rlsCodec== "avc":
if self.show.runtime > 30:
if (height=="1080p" and rlsSize <= 1000000000) or (height=="720p" and rlsSize <= 800000000):
quality = Quality.UNKNOWN
else:
if (height=="1080p" and rlsSize <= 700000000) or (height=="720p" and rlsSize <= 500000000):
quality = Quality.UNKNOWN
return quality