Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Channel): Add getters for all optional tabs #303

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented Feb 1, 2023

Description

Follow up to #296

Since making that pull request, I've noticed that there are auto generated channels that don't have any tabs like https://www.youtube.com/@gaming (technically it does have a single tab but it's unlabeled and doesn't have a navigation endpoint) so I've added getters for the remaining tabs. Additionally it doesn't have a search field, so I added a getter for that too.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@absidue
Copy link
Collaborator Author

absidue commented Feb 1, 2023

The failing test is a search one and is unrelated to any changes made in this pull request.

@ChunkyProgrammer
Copy link
Contributor

Would it be easy to add getters for the optional tabs on this channel too (I'm not sure as the channel is formatted weirdly)? https://www.youtube.com/channel/UC1Bi3laa7in6xWrOz2vx_sw

There is also a store tab that could be added to this PR:
https://www.youtube.com/@TakeOneTech/store

@LuanRT
Copy link
Owner

LuanRT commented Feb 1, 2023

Would it be easy to add getters for the optional tabs on this channel too (I'm not sure as the channel is formatted weirdly)? https://www.youtube.com/channel/UC1Bi3laa7in6xWrOz2vx_sw

Interesting, it does have the same overall structure of other channels, but that URL seems to redirect to this channel id: https://www.youtube.com/channel/UClgRkhTL3_hImCAmdLfDE4g (InnerTube returns a navigate action in the onResponseReceivedActions array), so we'd have to add some logic to handle that redirect otherwise the library will throw an error.

There is also a store tab that could be added to this PR: https://www.youtube.com/@TakeOneTech/store

There's no Channel#getStore() method for that tab yet, so that should probably be implemented first before adding the getter.

test/main.test.ts Outdated Show resolved Hide resolved
@absidue
Copy link
Collaborator Author

absidue commented Feb 1, 2023

whoops, definitely a typo 🙈

@LuanRT LuanRT merged commit b2900f4 into LuanRT:main Feb 2, 2023
@absidue absidue deleted the all-channel-tabs-optional branch February 2, 2023 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants