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

Migrate comments to YouTube.js #3072

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

absidue
Copy link
Member

@absidue absidue commented Jan 15, 2023

Migrate comments to YouTube.js

Pull Request Type

  • Other - Migration

Description

Migrated the comments to YouTube.js, this allows us to get rid of the @freetube/yt-comment-scraper dependency.

Nearly there 😁

Testing

Try the comments under various videos.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.18.0

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) January 15, 2023 22:42
@github-actions github-actions bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Jan 15, 2023
PikachuEXE
PikachuEXE previously approved these changes Jan 16, 2023
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Tested comment with loading more via local API

* @param {import('youtubei.js/dist/src/parser/classes/comments/Comment').default} comment
*/
export function parseLocalComment(comment, hasOwnerReplied = false, replyToken = null) {
return {
Copy link
Member

Choose a reason for hiding this comment

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

I like this. We should probably return new objects for other api calls as well in the future (i think this would be very useful for our invidious functions)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it will also allow us to return the data in the same format, that way we don't need separate handling for Invidious and local API data in ft-list-channel and similar components.

@ChunkyProgrammer
Copy link
Member

Tested with videos from the yt-comment-scraper tests:
https://github.com/FreeTubeApp/yt-comment-scraper/blob/development/test/scraper.test.js

@ChunkyProgrammer
Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc we need you! 😄

@FreeTubeBot FreeTubeBot merged commit 0145a04 into FreeTubeApp:development Jan 24, 2023
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 24, 2023
@absidue absidue deleted the youtubejs-comments branch January 24, 2023 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants