iv-org / documentation

The official Invidious documentation
https://docs.invidious.io
Creative Commons Zero v1.0 Universal
567 stars 154 forks source link

API property "type" in video object is not a constant despite documentation defining it as such #546

Closed shaedrich closed 3 months ago

shaedrich commented 3 months ago

https://github.com/iv-org/documentation/blob/3c2356b9b406632f1c0bbe64fefbdbd761a2b029/docs/api/common_types.md?plain=1#L31

Sometimes, it's returned as at least one other type: https://invidious.fdn.fr/api/v1/videos/0bbU76udgq8

    "type": "scheduled"
unixfox commented 3 months ago

Feel free to create a pull request.

shaedrich commented 3 months ago

For that, wouldn't it be good to know if there are any other possible values than "video" and "scheduled"?

SamantazFox commented 3 months ago

The common VideoObject type is not used for the /api/v1/videos endpoint, which has a different structure. Though the docs haven't been updated in a while... I need to work on merging the various PRs lying around.

shaedrich commented 3 months ago

Okay, that's weird/interesting. Thanks for the hint. However, the different structure is also different from the actual response. Since the docs don't list a type property for that endpoint at all, even though it is included in the actual response. Should I add the property to that different structure instead then?

SamantazFox commented 3 months ago

@shaedrich check if one of the pending PRs don't do that already. If not, the change is welcome :)

shaedrich commented 3 months ago

@SamantazFox Doesn't look like it, so I created a PR 🎉