fix: add widevine request retry logic to work around ratelimits #47

Open
ddirty830 wants to merge 1 commits from ddirty830/OF-DL:fix-widevine-cloudflare-retry into master
First-time contributor

I've noticed every once in a while I'd received an error Unable to parse license on DRM'd content.
I dug a little and found that the WideVine requests were getting a CloudFlare rate limit bounce back, so I've added some retry logic to the Widevine HttpUtil methods to attempt to retry when that occurs.

It's not perfect, since CloudFlare doesn't respond with a retry-after header in their response, so it's just arbitrary 10 second delays increasing to 20, an then 30 for subsequent retries. It'll only retry 3 times, and then throw an error.

I've noticed every once in a while I'd received an error `Unable to parse license` on DRM'd content. I dug a little and found that the WideVine requests were getting a CloudFlare rate limit bounce back, so I've added some retry logic to the Widevine HttpUtil methods to attempt to retry when that occurs. It's not perfect, since CloudFlare doesn't respond with a `retry-after` header in their response, so it's just arbitrary 10 second delays increasing to 20, an then 30 for subsequent retries. It'll only retry 3 times, and then throw an error.
ddirty830 added 1 commit 2025-08-17 17:45:40 +00:00
ddirty830 requested review from sim0n00ps 2025-08-18 00:48:52 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix-widevine-cloudflare-retry:ddirty830-fix-widevine-cloudflare-retry
git checkout ddirty830-fix-widevine-cloudflare-retry
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sim0n00ps/OF-DL#47
No description provided.