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

fix(#106): short hand view count parsing #107

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

antoniojps
Copy link
Contributor

@antoniojps antoniojps changed the title fix: short hand view count parsing #106 fix(#106): short hand view count parsing Jun 13, 2024
@SuspiciousLookingOwl
Copy link
Owner

Thanks for the PR.

I thought about adding something like this before for view count and upload date. But I decided not to proceed with this because others might use the client with a different language, for example

const client = new Client({
  youtubeClientOptions: {
    hl: "fr" // france
  }
});

If people do that, then the parser will not work properly, unless we include all parsers for every language available on YouTube, which I decided not to do since it will be out of this library's scope, and people will have to write their own parser for their language.

@antoniojps
Copy link
Contributor Author

antoniojps commented Jun 13, 2024

This will only parse IF it matches the K/M/B pattern so in theory it should never break any other language.

It will default to the parseInt otherwise.

WDYT? (Otherwise shorts views are irrelevant)

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.

2 participants