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

Merged
sim0n00ps merged 1 commits from ddirty830/OF-DL:fix-widevine-cloudflare-retry into master 2025-10-07 13:05:02 +00:00
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
Collaborator

This looks good to me and worked when I tested it 👍

This looks good to me and worked when I tested it 👍
sim0n00ps merged commit 78f6f1e611 into master 2025-10-07 13:05:02 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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