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

[Code Change] - Better Handling of rate limiting and other errors #10

Open
Anon-Exploiter opened this issue Jan 4, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@Anon-Exploiter
Copy link
Owner

Anon-Exploiter commented Jan 4, 2024

Currently the script just throws error "Sleeping for 10 seconds, server might be rate limiting!" on the following condition:

elif video_metadata.status_code == 401 or video_metadata.status_code == 403 or video_metadata.status_code == 502:
    logger.warning("Sleeping for 10 seconds, server might be rate limiting!")
    sleep(10)
    refresh_token(video_metadata)
    download_video(course_name, content_uuid, complete_path, index)

This is a bad implementation since these HTTP responses could be produced anywhere and aren't just limited to rate-limiting errors. Better way would be to parse the error body and based on that, determine if user is rate limited, session has expired, or something else needs to be done.

@Anon-Exploiter Anon-Exploiter changed the title [Code Change] - Handling of rate limiting and other errors [Code Change] - Better Handling of rate limiting and other errors Jan 4, 2024
@Anon-Exploiter Anon-Exploiter added the enhancement New feature or request label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant