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

[tests] Update user agent #1192

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

[tests] Update user agent #1192

wants to merge 4 commits into from

Conversation

TobiGr
Copy link
Member

@TobiGr TobiGr commented Jul 11, 2024

  • 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 updates the user agent used for testing purposes to a modern version.

This also modifies the RecordingDownloader to automatically prevent hitting rate limits ("sign in to confirm you are not a bot") + RecaptchaExceptions and handle them if they occur: There is now a max number of requests which are made per minute (default is 30). Requests are postponed if the limit is reached. When running into a RecaptchaException the RecordingDownloader waits between 35 and 60 seconds before retrying the request once again. This slows down the time for generating new mocks to ~5 minutes but prevents faulty mocks.

Warning

All YouTube tests passing the real tests also pass the new mock tests. However, the Bandcamp tests are failing locally now. Bandcamp tests run by GH Actions pass however.

@TobiGr TobiGr added the tests Issues and PR related to unit tests label Jul 11, 2024
@TobiGr
Copy link
Member Author

TobiGr commented Jul 13, 2024

All tests passing the real tests also pass the new mock tests.

@TobiGr TobiGr marked this pull request as ready for review July 13, 2024 07:55
@TobiGr TobiGr force-pushed the user-agent branch 3 times, most recently from 5fac4b7 to 92f420d Compare July 27, 2024 16:32
@TobiGr TobiGr force-pushed the user-agent branch 3 times, most recently from f1dbf5a to eff3b5e Compare November 3, 2024 22:28
@TobiGr TobiGr changed the title [test] Update user agent [tests] Update user agent Nov 6, 2024
Implement a max number of requests per minute to prevent hitting reate limits and triggering ReCaptchaExceptions. This slows down the RecordingDownloader significantly and can be adjusted if needed. A request ist retried once when facing a ReCaptchaException.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Issues and PR related to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant