mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-02-27 10:40:45 +08:00
fix: httpx proxy format error
feat: add a ip proxy provider
This commit is contained in:
BIN
docs/static/images/wd_http_img.png
vendored
Normal file
BIN
docs/static/images/wd_http_img.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 369 KiB |
BIN
docs/static/images/wd_http_img_1.png
vendored
Normal file
BIN
docs/static/images/wd_http_img_1.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 345 KiB |
BIN
docs/static/images/wd_http_img_2.png
vendored
Normal file
BIN
docs/static/images/wd_http_img_2.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 295 KiB |
BIN
docs/static/images/wd_http_img_4.png
vendored
Normal file
BIN
docs/static/images/wd_http_img_4.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 331 KiB |
44
docs/代理使用.md
44
docs/代理使用.md
@@ -5,45 +5,11 @@
|
||||
|
||||

|
||||
|
||||
## 准备代理 IP 信息
|
||||
点击 <a href="https://www.kuaidaili.com/?ref=ldwkjqipvz6c">快代理</a> 官网注册并实名认证(国内使用代理 IP 必须要实名,懂的都懂)
|
||||
|
||||
## 获取 IP 代理的密钥信息
|
||||
从 <a href="https://www.kuaidaili.com/?ref=ldwkjqipvz6c">快代理</a> 官网获取免费试用,如下图所示
|
||||

|
||||
## 选择一个代理IP提供商
|
||||
|
||||
注意:选择私密代理
|
||||

|
||||
|
||||
选择开通试用
|
||||

|
||||
|
||||
初始化一个快代理的示例,如下代码所示,需要4个参数
|
||||
|
||||
```python
|
||||
|
||||
def new_kuai_daili_proxy() -> KuaiDaiLiProxy:
|
||||
"""
|
||||
构造快代理HTTP实例
|
||||
Returns:
|
||||
|
||||
"""
|
||||
return KuaiDaiLiProxy(
|
||||
kdl_secret_id=os.getenv("kdl_secret_id", "你的快代理secert_id"),
|
||||
kdl_signature=os.getenv("kdl_signature", "你的快代理签名"),
|
||||
kdl_user_name=os.getenv("kdl_user_name", "你的快代理用户名"),
|
||||
kdl_user_pwd=os.getenv("kdl_user_pwd", "你的快代理密码"),
|
||||
)
|
||||
|
||||
```
|
||||
在试用的订单中可以看到这四个参数,如下图所示
|
||||
|
||||
`kdl_user_name`、`kdl_user_pwd`
|
||||

|
||||
|
||||
`kdl_secret_id`、`kdl_signature`
|
||||

|
||||
|
||||
## 将配置文件中的`ENABLE_IP_PROXY`置为 `True`
|
||||
> `IP_PROXY_POOL_COUNT` 池子中 IP 的数量
|
||||
### 快代理
|
||||
[快代理使用文档](快代理使用文档.md)
|
||||
|
||||
### 豌豆HTTP文档查看
|
||||
[豌豆HTTP使用文档](豌豆HTTP使用文档.md)
|
||||
41
docs/快代理使用文档.md
Normal file
41
docs/快代理使用文档.md
Normal file
@@ -0,0 +1,41 @@
|
||||
## 快代理使用文档(支持个人和企业用户)
|
||||
|
||||
## 准备代理 IP 信息
|
||||
点击 <a href="https://www.kuaidaili.com/?ref=ldwkjqipvz6c">快代理</a> 官网注册并实名认证(国内使用代理 IP 必须要实名,懂的都懂)
|
||||
|
||||
## 获取 IP 代理的密钥信息
|
||||
从 <a href="https://www.kuaidaili.com/?ref=ldwkjqipvz6c">快代理</a> 官网获取免费试用,如下图所示
|
||||

|
||||
|
||||
注意:选择私密代理
|
||||

|
||||
|
||||
选择开通试用
|
||||

|
||||
|
||||
初始化一个快代理的示例,如下代码所示,需要4个参数
|
||||
|
||||
```python
|
||||
# 文件地址: proxy/providers/kuai_daili_proxy.py
|
||||
# -*- coding: utf-8 -*-
|
||||
def new_kuai_daili_proxy() -> KuaiDaiLiProxy:
|
||||
"""
|
||||
构造快代理HTTP实例
|
||||
Returns:
|
||||
|
||||
"""
|
||||
return KuaiDaiLiProxy(
|
||||
kdl_secret_id=os.getenv("kdl_secret_id", "你的快代理secert_id"),
|
||||
kdl_signature=os.getenv("kdl_signature", "你的快代理签名"),
|
||||
kdl_user_name=os.getenv("kdl_user_name", "你的快代理用户名"),
|
||||
kdl_user_pwd=os.getenv("kdl_user_pwd", "你的快代理密码"),
|
||||
)
|
||||
|
||||
```
|
||||
在试用的订单中可以看到这四个参数,如下图所示
|
||||
|
||||
`kdl_user_name`、`kdl_user_pwd`
|
||||

|
||||
|
||||
`kdl_secret_id`、`kdl_signature`
|
||||

|
||||
38
docs/豌豆HTTP使用文档.md
Normal file
38
docs/豌豆HTTP使用文档.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## 豌豆HTTP代理使用文档 (只支持企业用户)
|
||||
|
||||
## 准备代理 IP 信息
|
||||
点击 <a href="https://h.wandouip.com?invite_code=rtnifi">豌豆HTTP代理</a> 官网注册并实名认证(国内使用代理 IP 必须要实名,懂的都懂)
|
||||
|
||||
## 获取 IP 代理的密钥信息 appkey
|
||||
从 <a href="https://h.wandouip.com?invite_code=rtnifi">豌豆HTTP代理</a> 官网获取免费试用,如下图所示
|
||||

|
||||
|
||||
选择自己需要的套餐
|
||||

|
||||
|
||||
|
||||
初始化一个豌豆HTTP代理的示例,如下代码所示,需要1个参数: app_key
|
||||
|
||||
```python
|
||||
# 文件地址: proxy/providers/wandou_http_proxy.py
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
def new_wandou_http_proxy() -> WanDouHttpProxy:
|
||||
"""
|
||||
构造豌豆HTTP实例
|
||||
Returns:
|
||||
|
||||
"""
|
||||
return WanDouHttpProxy(
|
||||
app_key=os.getenv(
|
||||
"wandou_app_key", "你的豌豆HTTP app_key"
|
||||
), # 通过环境变量的方式获取豌豆HTTP app_key
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
在个人中心的`开放接口`找到 `app_key`,如下图所示
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user