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
Ejemplo n.º 2
0
    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