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

[YouTube] Support handles and all channel usernames #964

Merged

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Nov 3, 2022

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

This PR adds support of YouTube handles into the extractor, and supports all user IDs instead of only the ones which match this regular expression.

Furthermore, in this PR, I added more non-channels endpoints to the list of excluded endpoints, improved and fixed documentation, comments and exception messages of YoutubeChannelLinkHandlerFactory, and moved its license header, updated on the fly, at its beginning.

Finally, I added new tests for handles and for a channel which have characters which doesn't match the regular expression linked above, and removed the unneeded public test modifiers for YoutubeChannelLinkHandlerFactoryTest.

I also make use of a handle for resolving the Gronkh channel ID instead of its custom name, and updated the mocks of this test, as it was needed.

Fixes #875 and TeamNewPipe/NewPipe#9243 for the extractor implementation.

@AudricV AudricV added bug Issue is related to a bug enhancement New feature or request youtube service, https://www.youtube.com/ labels Nov 3, 2022
@AudricV AudricV force-pushed the yt-support-handles-and-all-channel-usernames branch from b4c3d3d to 396d1d9 Compare November 3, 2022 18:44
More non-channel paths have been also added to the excluded custom name paths,
documentation and exception messages have been improved and fixed in some
places, and the licence header of YoutubeChannelLinkHandlerFactory has been
moved to its beginning and updated.
…s support

Unneeded public modifiers in test methods of
YoutubeChannelLinkHandlerFactoryTest have been also removed.
@AudricV AudricV force-pushed the yt-support-handles-and-all-channel-usernames branch from 396d1d9 to 20cd8e8 Compare November 3, 2022 18:47
}

final String id = splitPath[1];

if (id == null || !id.matches("[A-Za-z0-9_-]+")) {
throw new ParsingException("The given id is not a Youtube-Video-ID");
if (isBlank(id)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think we should use something else to match all custom names of channels or not?

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to have a channel ID that does not match the old pattern, e.g. by consisting of non latin characters?

Copy link
Member

Choose a reason for hiding this comment

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

@AudricV
Copy link
Member Author

AudricV commented Nov 4, 2022

Merging this PR now, as we could always improve this later, and a few more changes in the parsing logic are needed to fix #965 on the fly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug enhancement New feature or request youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

YouTube channel being detected as a PeerTube one
2 participants