Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.08k stars 87 forks source link

Allow ytarchive.py to work on premieres as well #65

Closed lbmaian closed 2 years ago

lbmaian commented 2 years ago

Saw the fix for #55 on the go version. Here's a simpler fix for the python version that looks at existence of playerResponse.microformat.playerMicroformatRenderer.liveBroadcastDetails.

Kethsar commented 2 years ago

The Python file is deprecated and not receiving updates anymore. You are free to add to/maintain it in your own fork, but I will not be accepting additions and plan to remove it entirely when I stop being lazy and create a github action to auto-build the golang version on commit.

lbmaian commented 2 years ago

Alright, but I looked at commit 7505ac0 and it could be simplified to just look at the existence of playerResponse.microformat.playerMicroformatRenderer.liveBroadcastDetails.

Kethsar commented 2 years ago

In Python, yes. That was also the first thing I had thought about checking for. However, Golang is different. The data structure is explicitly defined instead of dynamically generated based on the JSON. This means that even if the JSON field is not there, the field in the struct will be. Thus I check for an empty value that would otherwise always be set if the JSON has liveBroadcastDetails.