|
|
@ -15,15 +15,18 @@ Hero Union主要做两件事: |
|
|
|
1. [联盟成员使用流程](#联盟成员使用流程) |
|
|
|
1. [联盟成员使用流程](#联盟成员使用流程) |
|
|
|
2. [联盟的爬虫工作流程](#联盟的爬虫工作流程) |
|
|
|
2. [联盟的爬虫工作流程](#联盟的爬虫工作流程) |
|
|
|
* [Hero Union 联盟接口](#hero-union-联盟接口) |
|
|
|
* [Hero Union 联盟接口](#hero-union-联盟接口) |
|
|
|
1. [爬虫状态上报接口](#爬虫状态上报接口) |
|
|
|
1. [提交网页抓取任务接口](#提交网页抓取任务接口) |
|
|
|
2. [爬虫任务领取接口](#爬虫任务领取接口) |
|
|
|
2. [查询网页抓取任务结果接口](#查询网页抓取任务结果接口) |
|
|
|
3. [爬虫任务完成回传接口](#爬虫任务完成回传接口) |
|
|
|
3. [爬虫任务完成回调通知接口](#爬虫任务完成回调通知接口) |
|
|
|
4. [提交网页抓取任务接口](#提交网页抓取任务接口) |
|
|
|
4. [Hero爬虫查询接口](#Hero爬虫查询接口) |
|
|
|
5. [查询网页抓取任务结果接口](#查询网页抓取任务结果接口) |
|
|
|
5. [联盟状态查询接口](#联盟状态查询接口) |
|
|
|
6. [爬虫任务完成回调通知接口](#爬虫任务完成回调通知接口) |
|
|
|
6. [爬虫状态上报接口](#爬虫状态上报接口) |
|
|
|
7. [Hero爬虫查询接口](#Hero爬虫查询接口) |
|
|
|
7. [爬虫任务领取接口](#爬虫任务领取接口) |
|
|
|
8. [联盟状态查询接口](#联盟状态查询接口) |
|
|
|
8. [爬虫任务完成回传接口](#爬虫任务完成回传接口) |
|
|
|
|
|
|
|
* [接口参数签名方法](#接口参数签名方法) |
|
|
|
|
|
|
|
* [国内知名平台名称列表](#国内知名平台名称列表) |
|
|
|
|
|
|
|
* [Hero Union英雄联盟开发进度](#hero-union英雄联盟开发进度) |
|
|
|
|
|
|
|
* [其它参考](#其它参考) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Hero Union 英雄联盟使用流程 |
|
|
|
## Hero Union 英雄联盟使用流程 |
|
|
@ -68,65 +71,6 @@ Hero Union联盟网站:[Hero Union英雄联盟](https://herounion.filesite.io/ |
|
|
|
|
|
|
|
|
|
|
|
以下为联盟所有接口的详细文档: |
|
|
|
以下为联盟所有接口的详细文档: |
|
|
|
|
|
|
|
|
|
|
|
### 爬虫状态上报接口 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
https://herounion.filesite.io/api/onboard/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
* 请求方法:**POST** |
|
|
|
|
|
|
|
* 请求参数: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
name |
|
|
|
|
|
|
|
description |
|
|
|
|
|
|
|
status: [idle, busy] |
|
|
|
|
|
|
|
platforms: 爬虫支持的平台,可由爬虫定义,也可参考本文档底部“国内知名平台名称列表” |
|
|
|
|
|
|
|
contracts: 支持的数据抓取合约,具体内容由爬虫定义 |
|
|
|
|
|
|
|
timestamp |
|
|
|
|
|
|
|
country |
|
|
|
|
|
|
|
lang |
|
|
|
|
|
|
|
contact: 可选,爬虫提供方联系方式,将在英雄联盟网站展示,便于大家相互联系 |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
其中country国家代码和lang语言代码参数值请参考下面标准: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* [country代码参考两位ISO CODES](https://countrycode.org/) |
|
|
|
|
|
|
|
* [lang语言代码参考ISO 639-1 Code](https://www.loc.gov/standards/iso639-2/php/code_list.php) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫任务领取接口 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
https://herounion.filesite.io/api/gettask/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
* 请求方法:**GET** |
|
|
|
|
|
|
|
* 请求参数: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
platforms: 爬虫支持的平台 |
|
|
|
|
|
|
|
contracts: 爬虫支持的合约 |
|
|
|
|
|
|
|
country: 可选,爬虫所在国家 |
|
|
|
|
|
|
|
lang: 可选,爬虫支持的语言 |
|
|
|
|
|
|
|
data_mode: 可选,爬虫支持的返回数据格式 |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫任务完成回传接口 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
https://herounion.filesite.io/api/savetask/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
* 请求方法:**POST** |
|
|
|
|
|
|
|
* 请求参数: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
task_id |
|
|
|
|
|
|
|
task_result |
|
|
|
|
|
|
|
timestamp |
|
|
|
|
|
|
|
sign |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 提交网页抓取任务接口 |
|
|
|
### 提交网页抓取任务接口 |
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
* 接口网址: |
|
|
@ -152,9 +96,11 @@ sign |
|
|
|
* platform: url所属平台,目前支持的:抖音、快手、西瓜视频、bilibili |
|
|
|
* platform: url所属平台,目前支持的:抖音、快手、西瓜视频、bilibili |
|
|
|
* contract: 数据抓取合约,目前支持的:tajiantv,可由爬虫自定义并实现合约规则 |
|
|
|
* contract: 数据抓取合约,目前支持的:tajiantv,可由爬虫自定义并实现合约规则 |
|
|
|
* data_mode: 返回数据格式,默认:json,可选值:json、html |
|
|
|
* data_mode: 返回数据格式,默认:json,可选值:json、html |
|
|
|
|
|
|
|
* sign: 对所有参数进行签名,具体方法见文档底部[接口参数签名方法](#接口参数签名方法) |
|
|
|
|
|
|
|
|
|
|
|
返回值: |
|
|
|
返回值(以下其它接口返回值类似): |
|
|
|
如果提交完成,会返回新任务数据task。 |
|
|
|
* 如果提交完成,返回code=1、及新任务数据task |
|
|
|
|
|
|
|
* 如果提交失败,返回code=0、及错误信息message |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 查询网页抓取任务结果接口 |
|
|
|
### 查询网页抓取任务结果接口 |
|
|
@ -188,6 +134,10 @@ timestamp |
|
|
|
sign |
|
|
|
sign |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notify_url返回值: |
|
|
|
|
|
|
|
* 处理成功返回http status 200,其它状态码被视为失败 |
|
|
|
|
|
|
|
* 如果回调通知收到失败的状态码,将会在一定时间内再次重试 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Hero爬虫查询接口 |
|
|
|
### Hero爬虫查询接口 |
|
|
|
|
|
|
|
|
|
|
@ -202,6 +152,9 @@ page: 可选,从1开始的页码 |
|
|
|
limit: 可选,每页数量 |
|
|
|
limit: 可选,每页数量 |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
返回值: |
|
|
|
|
|
|
|
* 最多返回联盟最新的1000个爬虫 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 联盟状态查询接口 |
|
|
|
### 联盟状态查询接口 |
|
|
|
|
|
|
|
|
|
|
@ -212,6 +165,74 @@ https://herounion.filesite.io/api/stats/ |
|
|
|
* 请求方法:**GET** |
|
|
|
* 请求方法:**GET** |
|
|
|
* 请求参数:**无** |
|
|
|
* 请求参数:**无** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
返回值示例: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
start_time: 1712826714, |
|
|
|
|
|
|
|
taskStatus: { total: 6, waiting: 6, running: 0, done: 0, failed: 0 }, |
|
|
|
|
|
|
|
heroStatus: { total: 4, idle: 4, busy: 0, offline: 0 }, |
|
|
|
|
|
|
|
run_seconds: 94 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫状态上报接口 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
https://herounion.filesite.io/api/onboard/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
* 请求方法:**POST** |
|
|
|
|
|
|
|
* 请求参数: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
name |
|
|
|
|
|
|
|
description |
|
|
|
|
|
|
|
status: [idle, busy] |
|
|
|
|
|
|
|
platforms: 爬虫支持的平台,可由爬虫定义,也可参考本文档底部[国内知名平台名称列表](#国内知名平台名称列表) |
|
|
|
|
|
|
|
contracts: 支持的数据抓取合约,具体内容由爬虫定义 |
|
|
|
|
|
|
|
timestamp |
|
|
|
|
|
|
|
country |
|
|
|
|
|
|
|
lang |
|
|
|
|
|
|
|
contact: 可选,爬虫提供方联系方式,将在英雄联盟网站展示,便于大家相互联系 |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
参数说明,其中country国家代码和lang语言代码参数值请参考下面标准: |
|
|
|
|
|
|
|
* [country代码参考两位ISO CODES](https://countrycode.org/) |
|
|
|
|
|
|
|
* [lang语言代码参考ISO 639-1 Code](https://www.loc.gov/standards/iso639-2/php/code_list.php) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫任务领取接口 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
https://herounion.filesite.io/api/gettask/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
* 请求方法:**GET** |
|
|
|
|
|
|
|
* 请求参数: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
platforms: 爬虫支持的平台 |
|
|
|
|
|
|
|
contracts: 爬虫支持的合约 |
|
|
|
|
|
|
|
country: 可选,爬虫所在国家 |
|
|
|
|
|
|
|
lang: 可选,爬虫支持的语言 |
|
|
|
|
|
|
|
data_mode: 可选,爬虫支持的返回数据格式 |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫任务完成回传接口 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* 接口网址: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
https://herounion.filesite.io/api/savetask/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
* 请求方法:**POST** |
|
|
|
|
|
|
|
* 请求参数: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
task_id |
|
|
|
|
|
|
|
task_result |
|
|
|
|
|
|
|
timestamp |
|
|
|
|
|
|
|
sign |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 接口参数签名方法 |
|
|
|
## 接口参数签名方法 |
|
|
|
|
|
|
|
|
|
|
@ -256,8 +277,7 @@ var sign = md5( JSON.stringify(sortedParams) + token ); |
|
|
|
* v0.1 - beta 开发中,完成进度 80% 左右 |
|
|
|
* v0.1 - beta 开发中,完成进度 80% 左右 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 其它参考 |
|
|
|
## 参考 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
npm install 使用代理,本地socks转web proxy软件: |
|
|
|
npm install 使用代理,本地socks转web proxy软件: |
|
|
|
``` |
|
|
|
``` |
|
|
|