Skip to content

[DeviantArt] Dynamic Throttle#8900

Draft
bbappserver wants to merge 7685 commits intomikf:masterfrom
bbappserver:patch-1
Draft

[DeviantArt] Dynamic Throttle#8900
bbappserver wants to merge 7685 commits intomikf:masterfrom
bbappserver:patch-1

Conversation

@bbappserver
Copy link
Copy Markdown

Deviantart throttling right now i kind of bad and can have quite poor recovery performance.

When the user makes a request within the throttle period the period is increased in a tarpit probably with some exponential factor less than 2 as the DA API doc say you should use 2 as your exp backoff factor.

Current backoff logic does not account for this and moves the delay linearly which causes the user to be repeatedly penalized if they get a 429 for a long time until their throttling value gets huge, because the linear client delay is smaller than the tarpit so they will be penalized until some reset.

There are two proposed changes in this update:

  • When a throttle happens use exponential backoff with a factor of 2.
  • Under normal conditions try increasingly smaller sleep values until you are rejected to converge to whatever DA's backend currently considers the ideal sleep time.

mikf and others added 30 commits November 12, 2025 18:48
…f#7700 mikf#8553)

this breaks 'oauth:flickr' with the default key,
but it allows downloading without custom key / Flickr Pro
* Create cfake.py
* Update __init__.py
* Create cfake.py tests
* update
    - simplify & combine code
    - adjust 'pattern': use '[^/?#]', match lines and groups
    - generalize example URLs
    - update default filenames
* update docs/supportedsites
* update test results

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
* [aryion] Implement search extractor.
* [aryion] Update capabilities.
* [aryion] Adjust example.
* fix flake8 errors

* update & simplify
    - use existing '_pagination_next()'
    - remove '_pagination_search()'
    - update 'search[…]' metadata
* add tests

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
* Add support for sxypix.com
* update & simplify
    - text.extract -> text.extr
    - self.request().json() -> self.request_json()
    - use self.groups
    - remove __init__
    - list comprehension
* update test results

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
* Add support for ok.porn
* update
    - adjust pattern/example/page_url
    - prevent unnecessary request
    - extract 'tags'
    - text.extract -> text.extr
    - return list comprehension result
* update supportedsites name
* update test results

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
* Add support for pornstars.tube
* update
    - adjust pattern/example/page_url
    - extract '' & '' metadata
    - prevent unnecessary request
    - fix result URLs
    - return list comprehension result
* update supportedsites
* update test results
* fix extractor name

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
- skip 'build_query()' step
- add underscores to prefixes
Fixes:
```sh
python scripts/init.py newsite https://newsite.com
# [INFO] gallery_dl/extractor/newsite.py
# [ERROR] TypeError: 'NoneType' object is not iterable
# Traceback (most recent call last):
#   File "/gallery-dl/scripts/init.py", line 58, in init_extractor
#     fp.write(func(args))
#              ^^^^^^^^^^
#   File "/gallery-dl/scripts/init.py", line 88, in generate_module
#     {generate_extractors(args)}\
#      ^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/gallery-dl/scripts/init.py", line 108, in generate_extractors_basic
#     for subcat in args.subcategories:
# TypeError: 'NoneType' object is not iterable
# [INFO] gallery_dl/extractor/__init__.py
# [INFO] test/results/newsite.py
```
* [eporner] Add support
* Line-length <80 chars
* Fix flake8 indentation
* update
    - generalize example URL
    - strip "Photo Gallery" from 'title'
    - extract 'id'
* update supportedsites
* update test results
* include full metadata object with each url
    Fixes mikf#4286
* rename 'url_metadata' to 'file'
with the default '"order-posts": "desc"'
with the default '"order-posts": "desc"'
mikf and others added 20 commits January 13, 2026 10:07
use server invite link that will never expire
mikf#8803 (comment)
to allow disabling the behavior introduced in commit
a79a945
* adding site support for thefap.com
* fixing typo in url tld
* improve & simplify 'model' extractor
* update 'post' extractor
* update docs/supportedsites
* add tests

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
some instances respond with redirects when using these URLs as is
* Add alternate turbovid domain
* simplify regex pattern
* add tests
@bbappserver bbappserver force-pushed the patch-1 branch 2 times, most recently from e774e70 to 1efce7c Compare January 18, 2026 14:18
…ckoff

Introduced a LearningDelay class to manage API throttling dynamically. Updated the DeviantartOAuthAPI to utilize the new delay mechanism for improved handling of rate limits.

Recover frame rate limiting with exponential backoff instead of linear.
@mikf
Copy link
Copy Markdown
Owner

mikf commented Jan 18, 2026

By the way, I have plans on completely rewriting the DA module without any OAuth API usage. Soon ™️. So working on any OAuth API features or improvements is kind of pointless. At least in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.