mdbq 4.0.100__tar.gz → 4.0.101__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mdbq might be problematic. Click here for more details.
- {mdbq-4.0.100 → mdbq-4.0.101}/PKG-INFO +1 -1
- mdbq-4.0.101/mdbq/__version__.py +1 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/auth/rate_limiter.py +10 -6
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq.egg-info/PKG-INFO +1 -1
- mdbq-4.0.100/mdbq/__version__.py +0 -1
- {mdbq-4.0.100 → mdbq-4.0.101}/README.txt +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/auth/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/auth/auth_backend.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/js/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/js/jc.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/log/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/log/mylogger.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/myconf/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/myconf/myconf.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/mysql/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/mysql/deduplicator.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/mysql/mysql.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/mysql/s_query.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/mysql/unique_.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/mysql/uploader.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/other/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/other/download_sku_picture.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/other/error_handler.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/other/otk.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/other/pov_city.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/other/ua_sj.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/pbix/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/pbix/pbix_refresh.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/pbix/refresh_all.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/redis/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/redis/getredis.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/route/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/route/analytics.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/route/monitor.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/route/routes.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/selenium/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/selenium/get_driver.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq/spider/__init__.py +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq.egg-info/SOURCES.txt +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq.egg-info/dependency_links.txt +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/mdbq.egg-info/top_level.txt +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/setup.cfg +0 -0
- {mdbq-4.0.100 → mdbq-4.0.101}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '4.0.101'
|
|
@@ -495,12 +495,16 @@ class RateLimitDecorators:
|
|
|
495
495
|
if isinstance(response, tuple) and len(response) >= 2:
|
|
496
496
|
response_data, status_code = response[0], response[1]
|
|
497
497
|
if hasattr(response_data, 'headers'):
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
498
|
+
try:
|
|
499
|
+
rule = self.limiter.rules.get(api_type, {}).get(user_level)
|
|
500
|
+
if rule and hasattr(rule, 'requests') and hasattr(rule, 'window'):
|
|
501
|
+
response_data.headers['X-RateLimit-Limit'] = str(rule.requests)
|
|
502
|
+
response_data.headers['X-RateLimit-Remaining'] = str(remaining)
|
|
503
|
+
response_data.headers['X-RateLimit-Reset'] = str(int(time.time() + rule.window))
|
|
504
|
+
response_data.headers['X-RateLimit-Policy'] = f"{api_type}:{user_level.value}"
|
|
505
|
+
except (AttributeError, KeyError, TypeError):
|
|
506
|
+
# 忽略头部设置错误,不影响主要功能
|
|
507
|
+
pass
|
|
504
508
|
|
|
505
509
|
return response
|
|
506
510
|
|
mdbq-4.0.100/mdbq/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '4.0.100'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|