Improve the logic of choosing main or high

This commit is contained in:
Jared-02 2021-10-25 02:48:50 +08:00
parent ac5049ad81
commit 557d6554f0

View File

@ -409,13 +409,21 @@ class get_manifest:
if getHigh:
HighVideoList = self.HighVideoMSL()
if not HighVideoList == []:
# 判断high或main要求main比high的vamf更大的情况下选择main
# main和high的vamf相同时选择high
# 判断main或high要求
# main和high的vamf不同时选择vamf更高者
# main和high的vamf相同时选择bitrate更高者
if dict(VideoList[-1])["vmaf"]:
if int(dict(VideoList[-1])["vmaf"]) >= int(dict(HighVideoList[-1])["vmaf"]) and int(dict(VideoList[-1])["Bitrate"]) >= int(dict(HighVideoList[-1])["Bitrate"]):
check_high_or_main = "MAIN"
else: check_high_or_main = "HIGH"
# vamf=None时通过码率判断
elif dict(VideoList[-1])["Bitrate"]:
if int(dict(VideoList[-1])["Bitrate"]) >= int(dict(HighVideoList[-1])["Bitrate"]):
check_high_or_main = "MAIN"
else: check_high_or_main = "HIGH"
else: self.logger.info("There was something wrong with getting manifest!")
checkerinfo = "\nNetflix Profile Checker v1.1\n2021-10-19 Jared_mod\n\nMain Rate: {}kbps | Vamf: {} | Profile: {}\nHigh Rate: {}kbps | Vamf: {} | Profile: {}\n\nResult: {} is Better!\n"
checkerinfo = "\nNetflix Profile Checker v1.1\n2021-10-25 Jared_mod\n\nMain Rate: {}kbps | Vamf: {} | Profile: {}\nHigh Rate: {}kbps | Vamf: {} | Profile: {}\n\nResult: {} is Better!\n"
checkerinfo = checkerinfo.format(
str(dict(VideoList[-1])["Bitrate"]),
str(dict(VideoList[-1])["vmaf"]),