invidious icon indicating copy to clipboard operation
invidious copied to clipboard

Channel home page from API?

Open LeNub64 opened this issue 5 months ago • 7 comments

so when using the api, i tried to get shorts from UCFQMnBA3CS502aghlcr0_aw (Coffeezilla), when i did, i got this

videos |   0 |   type | "category" title | "Videos" contents | […] 1 |   type | "category" title | "Traders Domain" contents | […] 2 |   type | "category" title | "Investigating CryptoZoo" contents | […] ...

i used the following url https://iv.ggtyler.dev/api/v1/channels/UCFQMnBA3CS502aghlcr0_aw/shorts

im not sure if i can use this on other channels which have shorts, but id like to know.

LeNub64 avatar Jan 26 '24 03:01 LeNub64

The channel doesn't have a shorts tab, so the correct response in this case should be an error saying that the tab doesn't exist. YouTube redirects to the homepage when you request a non-existent tab, looks like Invidious is missing a check to detect that and return an error message about the tab not existing. The endpoint works correctly for channels that do have a shorts tab.

To check if a channel has a tab before you try requesting it, you should request the channel API endpoint first /api/v1/channels/<channel_id> and check the tabs field.

absidue avatar Jan 26 '24 09:01 absidue

i kinda guessed that, but was wondering if it was possible to get a result like that on any channel.

LeNub64 avatar Jan 26 '24 17:01 LeNub64

The big question is why? It only shows content that is already available on other tabs.

Also there is no consistency across channels as it's customisable by the channel owner, so which sections appear, in what order and what titles they have is different on every channel, additionally the sections don't have any identifiers other than the inconsistent section titles. So working with them is an absolute nightmare.

absidue avatar Jan 28 '24 20:01 absidue

that's a fair point. i just thought id be nice for the users? im not sure, i just saw it was possible and was wondering if it could be added.

also kinda unrelated, but the /channels endpoint for the channels doesn't seem to work.

LeNub64 avatar Jan 29 '24 21:01 LeNub64

YouTube removed the channels tab.

absidue avatar Jan 29 '24 21:01 absidue

then it would likely be a good idea to update the docs for that section saying it no longer works

LeNub64 avatar Jan 29 '24 21:01 LeNub64

then it would likely be a good idea to update the docs for that section saying it no longer works

Feel free to submit a pull request! Repository is here: https://github.com/iv-org/documentation

unixfox avatar Jan 29 '24 21:01 unixfox