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(yt): add getGuide() #335

Merged
merged 6 commits into from
Mar 4, 2023
Merged

feat(yt): add getGuide() #335

merged 6 commits into from
Mar 4, 2023

Conversation

patrickkfkan
Copy link
Contributor

Add support for fetching YouTube's content guide, contents of which you will find in the left sidebar of YT website:

image

Usage

const guide = await youtube.getGuide();

// guide.contents:
[
    {
      "type": "GuideSection",
      "items": [
        {
          "type": "GuideEntry",
          "title": {
            "text": "Home"
          },
          "endpoint": {
            "type": "NavigationEndpoint",
            "payload": {
              "browseId": "FEwhat_to_watch"
            },
            "metadata": {
              "url": "/",
              "page_type": "WEB_PAGE_TYPE_BROWSE",
              "api_url": "browse"
            }
          },
          "icon_type": "WHAT_TO_WATCH",
          "is_primary": true
        }
        ...
      ]
    }
    ...
]

@LuanRT
Copy link
Owner

LuanRT commented Mar 4, 2023

Looks good. Only thing I think should be added is a getter for the private page prop in the Guide class. This way, users can get the original data and parse however they want.

@patrickkfkan
Copy link
Contributor Author

Agree. Added.

@LuanRT
Copy link
Owner

LuanRT commented Mar 4, 2023

Awesome, merging now. And as always, thank you!

@LuanRT LuanRT merged commit 2cc7b8b into LuanRT:main Mar 4, 2023
@patrickkfkan patrickkfkan deleted the yt_guide branch March 7, 2023 09:36
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.

2 participants