twlite / youtube-sr

A dead-simple youtube metadata scraper
https://npmjs.com/package/youtube-sr
MIT License
113 stars 16 forks source link

Live videos are not marked as live #60

Open RadSton opened 5 months ago

RadSton commented 5 months ago

When you search for a live video using Youtube.search the video does not get marked as live!

This is because https://github.com/twlite/youtube-sr/blob/45a23dbf1bf7f00aba09de6010a7104a2ea332ad/src/Util.ts#L236 doesn't check if the video is live!

It could be checked if a badge (data.videoRenderer.badges) with the name "liveBadge" exists!

Since data.videoRenderer.badges for a live video looks as following:

"badges": [
    {
        "liveBadge": {
            "label": {
                "simpleText": "Live now"
            }
        }
    }
]