fix: yattee's mpv-specific resolution workaround
for some reason Yattee's mpv backend won't play videos which are using an "unusual" aspect ratio (at least ones which are not 360p)
This commit is contained in:
@@ -279,7 +279,7 @@ def rebuildFormatsFromYtdlpApi(ydata: dict):
|
|||||||
height = str(safeTraverse(stream, ["height"], default=0))
|
height = str(safeTraverse(stream, ["height"], default=0))
|
||||||
width = str(safeTraverse(stream, [ "width"], default=0))
|
width = str(safeTraverse(stream, [ "width"], default=0))
|
||||||
newRow[ "type"] = "video/" + type
|
newRow[ "type"] = "video/" + type
|
||||||
newRow[ "resolution"] = height + "p"
|
newRow[ "resolution"] = (height if height in ("144", "240", "360", "480", "720", "1080") else "360") + "p" # mpv won't play the video inside of Yattee if it's a non-standard resolution (bug?)
|
||||||
newRow[ "fps"] = safeTraverse(stream, ["fps"], default=30)
|
newRow[ "fps"] = safeTraverse(stream, ["fps"], default=30)
|
||||||
newRow[ "qualityLabel"] = height + "p" + str(int(newRow['fps'])) * (newRow["fps"] > 30) # also a placeholder
|
newRow[ "qualityLabel"] = height + "p" + str(int(newRow['fps'])) * (newRow["fps"] > 30) # also a placeholder
|
||||||
newRow[ "size"] = width + "x" + height
|
newRow[ "size"] = width + "x" + height
|
||||||
|
|||||||
Reference in New Issue
Block a user