user234683 / youtube-local

browser-based client for watching Youtube anonymously and with greater page performance
GNU Affero General Public License v3.0
486 stars 62 forks source link

Add functional but preliminary channel tab support #170

Closed David-JonesDVN closed 1 year ago

David-JonesDVN commented 1 year ago

Adds the foundation for displaying channel tabs (shorts and livestreams) on the channel page. the reason I call this "preliminary" is due to a severe lack of polish.

What does work: Shorts and Streams tabs' first page Pagination and view sort for streams Views and duration for shorts

What does not work: Pagination and view sort for shorts. I haven't managed to look too deep into it, but it appears that the continuation token for shorts sends the last short in the current page to get the next page, so I'm not sure if arbitrary paging is possible at the moment. The number of pages on tabs. Due to how it's calculated, I don't know if it's possible to get the correct count for each tab. Therefore the number of pages will always be equal or larger than the true number on each tab.

Apologies if this pull request feels barebones. I hope for the code here to be used more as a general blueprint for the feature if not something that is good enough for merging.

David-JonesDVN commented 1 year ago

Also, pagination for streams doesn't work on my end on this channel; it returns the first page always: https://www.youtube.com/channel/UC6nZlvfz4YWoBWbjiaYJA3g/streams

It appears Youtube has changed the continuation token's format a bit at least since yesterday; The offset value is now an unsigned int with field number 1, instead of a string with field number 2. I haven't included that change in this pull request, but can if needed.