YouTube.getVideo("Some_Video_URL") returns an error:
Error: Cannot read properties of undefined (reading 'accessibilityData')
for videos that don't have their ratings visible. An example of a video that doesn't show it's ratings is https://www.youtube.com/watch?v=LL998ajnjN4 and has been used in the testing of this fix. An additional video that doesn't have ratings enabled (currently at least) is https://www.youtube.com/watch?v=aKSxbt-O6TA and can also be used for testing.
This fix makes the accessibility property in getInfoLikesCount() optional for when a video has their number of likes hidden and there is no accessibility property available.
Additionally, this adds an || OR operator to a video's like ratings that returns 0 if getInfoLikesCount(info) returns NaN after being unable to return the likes count of a video.
YouTube.getVideo("Some_Video_URL")
returns an error:Error: Cannot read properties of undefined (reading 'accessibilityData')
for videos that don't have their ratings visible. An example of a video that doesn't show it's ratings is https://www.youtube.com/watch?v=LL998ajnjN4 and has been used in the testing of this fix. An additional video that doesn't have ratings enabled (currently at least) is https://www.youtube.com/watch?v=aKSxbt-O6TA and can also be used for testing.This fix makes the accessibility property in getInfoLikesCount() optional for when a video has their number of likes hidden and there is no accessibility property available.
Additionally, this adds an || OR operator to a video's like ratings that returns 0 if getInfoLikesCount(info) returns NaN after being unable to return the likes count of a video.