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

Optimizing commentThread API call #3

Open
knightron0 opened this issue Sep 16, 2021 · 0 comments
Open

Optimizing commentThread API call #3

knightron0 opened this issue Sep 16, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@knightron0
Copy link
Owner

The API quota for the YouTube Data API is ridiculously low (10,000 requests per day, each request can return maximum 100 comments) and my application for an extension has been under review for over two weeks now. (This is precisely why the extension does not work approaching 12:00 AM PDT)

According to my research before release, the only way of reducing the number of requests was by utilizing the searchTerms field in the API call. Out of the many approaches I tried, I found that adding half-timestamps in the following format to the searchTerms field works the best:

"0: | 1: | 2: ....  59: | 1:00: | 1:01:"

Here are some comparisons I did a month ago between the naive approach and this one.

Video: 33,832 total comments

Approach Number of requests Timestamped comments found
Naive 236 1085
Optimized 106 1076

Video: 71,071 total comments

Approach Number of requests Timestamped comments found
Naive 587 1013
Optimized 38 998

The number of requests was drastically decreased with a minor change in the number of timestamped comments found. Since there are non-timestamped comments that pass through the filter and timestamped comments that don't get included, the current approach is fairly suboptimal and can be improved.

@knightron0 knightron0 added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant