Commit 5703e1c
RedditRipper: rate-limit v.redd.it, fix silent video-download failures
Fixes #219 (ripmeapp2/ripme): "images are downloaded but no videos".
handleURL() runs synchronously per post with no delay, so a listing
full of video posts hit v.redd.it's DASH manifest/video endpoints
back-to-back. redgifs.com already gets a 3s delay right below this
for exactly this reason ("redgifs.com rate limits us if we download
too fast") -- v.redd.it never got the same treatment despite being
at least as common a link on Reddit.
Also fixes two silent-failure bugs found along the way:
- parseRedditVideoMPD's catch block used e.printStackTrace(), which
isn't routed through log4j2 at all -- failures were invisible in
normal operation.
- when parseRedditVideoMPD returns null, the video was silently
skipped with no log output whatsoever. Now logs a warning so a
skipped video is diagnosable instead of just vanishing.
Verified the DASH-manifest parsing logic itself is correct: fetched
the manifest from the reporter's own v.redd.it ID directly, confirmed
it selects DASH_360.mp4 as the best-quality representation (matching
the report exactly), and that URL downloads fine. Could not directly
reproduce a rate-limit failure via manual concurrent-request testing,
so this fix targets the most plausible explanation matching the
established redgifs.com precedent in the same method, not a
confirmed root cause.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 01c622c commit 5703e1c
1 file changed
Lines changed: 7 additions & 1 deletion
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
439 | 443 | | |
440 | 444 | | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
444 | 448 | | |
| 449 | + | |
| 450 | + | |
445 | 451 | | |
446 | 452 | | |
447 | 453 | | |
| |||
0 commit comments