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

Add YouTube channel tooltip support #157

Merged
merged 63 commits into from
Jul 31, 2021

Conversation

jupjohn
Copy link
Contributor

@jupjohn jupjohn commented Jun 2, 2021

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

This PR aims to add support for YouTube channel links. Currently it only supports youtube.com/{channel,user,c}/<id_or_name> links. Ideally this would also extend to custom channel links such as youtube.com/tranceluv but that's up for discussion as to how.

Tested locally and confirmed that /user/, /channel/ and /c/ work.

TODO:

  • Support youtube.com/c/<channel> links
  • Support youtube.com/<channel> links won't do for now
  • Clean up link matching to use regex match (means we don't need to do two checks to figure out if it's an ID or a channel name)

Closes #148

@jupjohn
Copy link
Contributor Author

jupjohn commented Jun 2, 2021

Implements #148 (didn't see that until now)

@jupjohn
Copy link
Contributor Author

jupjohn commented Jun 2, 2021

Also needs a rework on how it caches the channels, will look into tomorrow.

@jupjohn jupjohn marked this pull request as ready for review June 2, 2021 23:39
@jupjohn
Copy link
Contributor Author

jupjohn commented Jun 3, 2021

/c/channel_name URLs only half work. When the custom URL matches the channel name the API response contains the channel. If the name is different we get nothing. Will look into a fix later today

@jupjohn
Copy link
Contributor Author

jupjohn commented Jun 27, 2021

Thanks snake man, you beat me to it
image

@@ -12,6 +12,7 @@

- Made Reddit Score field in Livestreamfails tooltip use humanized value. (#164)
- Added support for customizable oEmbed resolving for websites with the `providers.json` file. See [`data/oembed/providers.json`](data/oembed/providers.json). Three new environment variables can be set. See [`internal/resolvers/oembed/README.md`](internal/resolvers/oembed/README.md) (#139, #152)
- Added support for YouTube channel links. (#157)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry needs to move up to the ## Unreleased section

As pajlada said, cfg in main.go is a singleton that we shouldn't rely on in tests in case it'd change or get removed.
@Chatterino Chatterino deleted a comment from zneix Jun 27, 2021
@Chatterino Chatterino deleted a comment from jupjohn Jun 27, 2021
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some requested changes - will need a rereview once that's been gone through

internal/resolvers/youtube/model.go Outdated Show resolved Hide resolved
internal/resolvers/youtube/model.go Outdated Show resolved Hide resolved
internal/resolvers/youtube/resolver.go Show resolved Hide resolved
internal/resolvers/youtube/resolver.go Show resolved Hide resolved
internal/resolvers/youtube/helpers.go Outdated Show resolved Hide resolved
internal/resolvers/youtube/helpers.go Outdated Show resolved Hide resolved
internal/resolvers/youtube/helpers.go Outdated Show resolved Hide resolved
internal/resolvers/youtube/helpers.go Outdated Show resolved Hide resolved
internal/resolvers/youtube/helpers.go Outdated Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) July 31, 2021 10:46
@pajlada pajlada merged commit 9844c07 into Chatterino:master Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Youtube Channel support
3 participants