akshare-proxy-patch 0.2.9__tar.gz → 0.2.10__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 akshare-proxy-patch might be problematic. Click here for more details.

@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akshare-proxy-patch
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: 针对 AkShare 和 efinance 的底层补丁,自动为东财等接口注入代理认证头,从而避免 `stock_zh_a_spot_em` 等方法报错。
5
5
  Home-page: https://github.com/helloyie/akshare-proxy-patch
6
6
  Author: cheapproxy.net
7
7
  Author-email: cheapproxy <emezxyj1@gmail.com>
8
- Project-URL: Homepage, https://github.com/cheapproxy/akshare-proxy-patch
8
+ Project-URL: Homepage, https://github.com/helloyie/akshare-proxy-patch
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
@@ -20,7 +20,7 @@ Dynamic: requires-python
20
20
 
21
21
  # AkShare Proxy Patch
22
22
 
23
- 针对 `akshare` 和 `efinance` 的插件补丁,自动为接口注入请求头,从而避免`stock_zh_a_spot_em`、`get_realtime_quotes` 等接口报错问题。
23
+ 针对 `akshare` 和 `efinance` 的插件补丁,自动为接口注入请求头,解决 `stock_zh_a_spot_em`、`stock_zh_a_hist`、`get_realtime_quotes` 等东财接口报错问题。
24
24
 
25
25
  ## 安装
26
26
 
@@ -29,7 +29,7 @@ Dynamic: requires-python
29
29
  2. 安装 `akshare-proxy-patch` 插件
30
30
 
31
31
  ```
32
- pip install akshare-proxy-patch==0.2.8
32
+ pip install akshare-proxy-patch==0.2.9
33
33
  ```
34
34
 
35
35
  ## 使用方法
@@ -98,4 +98,4 @@ if __name__ == '__main__':
98
98
 
99
99
  如使用时遇到问题,或对插件有什么意见或建议,可进群交流:
100
100
 
101
- ![7sEblPiT7tEdCPrA3nEyekVYxsMZDDgy.webp](https://picui.ogmua.cn/s1/2026/03/03/69a64a45bbda0.webp)
101
+ ![wPcUf9H0jIdRXSWKhk8BZ24wbDVnufQe.webp](https://cdn.nodeimage.com/i/wPcUf9H0jIdRXSWKhk8BZ24wbDVnufQe.webp)
@@ -1,6 +1,6 @@
1
1
  # AkShare Proxy Patch
2
2
 
3
- 针对 `akshare` 和 `efinance` 的插件补丁,自动为接口注入请求头,从而避免`stock_zh_a_spot_em`、`get_realtime_quotes` 等接口报错问题。
3
+ 针对 `akshare` 和 `efinance` 的插件补丁,自动为接口注入请求头,解决 `stock_zh_a_spot_em`、`stock_zh_a_hist`、`get_realtime_quotes` 等东财接口报错问题。
4
4
 
5
5
  ## 安装
6
6
 
@@ -9,7 +9,7 @@
9
9
  2. 安装 `akshare-proxy-patch` 插件
10
10
 
11
11
  ```
12
- pip install akshare-proxy-patch==0.2.8
12
+ pip install akshare-proxy-patch==0.2.9
13
13
  ```
14
14
 
15
15
  ## 使用方法
@@ -78,4 +78,4 @@ if __name__ == '__main__':
78
78
 
79
79
  如使用时遇到问题,或对插件有什么意见或建议,可进群交流:
80
80
 
81
- ![7sEblPiT7tEdCPrA3nEyekVYxsMZDDgy.webp](https://picui.ogmua.cn/s1/2026/03/03/69a64a45bbda0.webp)
81
+ ![wPcUf9H0jIdRXSWKhk8BZ24wbDVnufQe.webp](https://cdn.nodeimage.com/i/wPcUf9H0jIdRXSWKhk8BZ24wbDVnufQe.webp)
@@ -1,8 +1,9 @@
1
1
  import time
2
2
  import threading
3
3
  import requests
4
+ from urllib.parse import urlparse
4
5
 
5
- __version__ = "0.2.9"
6
+ __version__ = "0.2.10"
6
7
  # 备份 Session 的原始 request 方法,这是所有 requests.get/post 的最终入口
7
8
  _original_request = requests.Session.request
8
9
  _auth_session = requests.Session()
@@ -59,8 +60,9 @@ def install_patch(auth_ip, auth_token, retry=30):
59
60
  "push2his.eastmoney.com",
60
61
  ]
61
62
  )
63
+ is_js = urlparse(url or "").path.lower().endswith(".js")
62
64
 
63
- if not is_target:
65
+ if not is_target or is_js:
64
66
  return _original_request(self, method, url, **kwargs)
65
67
 
66
68
  auth_url = f"http://{auth_ip}:47001/api/akshare-auth"
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akshare-proxy-patch
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: 针对 AkShare 和 efinance 的底层补丁,自动为东财等接口注入代理认证头,从而避免 `stock_zh_a_spot_em` 等方法报错。
5
5
  Home-page: https://github.com/helloyie/akshare-proxy-patch
6
6
  Author: cheapproxy.net
7
7
  Author-email: cheapproxy <emezxyj1@gmail.com>
8
- Project-URL: Homepage, https://github.com/cheapproxy/akshare-proxy-patch
8
+ Project-URL: Homepage, https://github.com/helloyie/akshare-proxy-patch
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
@@ -20,7 +20,7 @@ Dynamic: requires-python
20
20
 
21
21
  # AkShare Proxy Patch
22
22
 
23
- 针对 `akshare` 和 `efinance` 的插件补丁,自动为接口注入请求头,从而避免`stock_zh_a_spot_em`、`get_realtime_quotes` 等接口报错问题。
23
+ 针对 `akshare` 和 `efinance` 的插件补丁,自动为接口注入请求头,解决 `stock_zh_a_spot_em`、`stock_zh_a_hist`、`get_realtime_quotes` 等东财接口报错问题。
24
24
 
25
25
  ## 安装
26
26
 
@@ -29,7 +29,7 @@ Dynamic: requires-python
29
29
  2. 安装 `akshare-proxy-patch` 插件
30
30
 
31
31
  ```
32
- pip install akshare-proxy-patch==0.2.8
32
+ pip install akshare-proxy-patch==0.2.9
33
33
  ```
34
34
 
35
35
  ## 使用方法
@@ -98,4 +98,4 @@ if __name__ == '__main__':
98
98
 
99
99
  如使用时遇到问题,或对插件有什么意见或建议,可进群交流:
100
100
 
101
- ![7sEblPiT7tEdCPrA3nEyekVYxsMZDDgy.webp](https://picui.ogmua.cn/s1/2026/03/03/69a64a45bbda0.webp)
101
+ ![wPcUf9H0jIdRXSWKhk8BZ24wbDVnufQe.webp](https://cdn.nodeimage.com/i/wPcUf9H0jIdRXSWKhk8BZ24wbDVnufQe.webp)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "akshare-proxy-patch" # 包名,需在 PyPI 唯一
7
- version = "0.2.9"
7
+ version = "0.2.10"
8
8
  authors = [
9
9
  { name="cheapproxy", email="emezxyj1@gmail.com" },
10
10
  ]
@@ -21,4 +21,4 @@ classifiers = [
21
21
  ]
22
22
 
23
23
  [project.urls]
24
- "Homepage" = "https://github.com/cheapproxy/akshare-proxy-patch"
24
+ "Homepage" = "https://github.com/helloyie/akshare-proxy-patch"
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="akshare-proxy-patch", # 包名,用户 pip install 时的名称
8
- version="0.2.9",
8
+ version="0.2.10",
9
9
  author="cheapproxy.net",
10
10
  author_email="emezxyj1@gmail.com",
11
11
  description="AkShare 和 efinance 报错全局Hook",