-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from xrgzs/feat/add-mcloud
feat: add 中国移动云盘
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#:schema ../../schema/task.json | ||
# 任务基本信息 | ||
[task] | ||
name = "中国移动云盘" | ||
category = "下载上传" | ||
author = "xrgzs" | ||
url = "https://yun.139.com/" | ||
|
||
# 指定使用的模板 | ||
[template] | ||
scraper = "External" | ||
# resolver = "" | ||
producer = "Recursive_Unzip" | ||
|
||
# 使用到的正则 | ||
[regex] | ||
# download_link = '' | ||
download_name = '\.exe' | ||
# scraper_version = '' | ||
|
||
# 通用参数 | ||
[parameter] | ||
# resolver_cd = [] | ||
# compress_level = 5 | ||
build_manifest = ["${taskName}.wcs","${taskName}/mCloud.exe"] | ||
# build_cover = "" | ||
# build_delete = [] | ||
|
||
# 爬虫模板临时参数 | ||
# [scraper_temp] | ||
|
||
# 自动制作模板要求的参数 | ||
[producer_required] | ||
shortcutName = "中国移动云盘" | ||
sourceFile = "mCloud.exe" | ||
recursiveUnzipList = [ 'app.7z' ] | ||
|
||
|
||
# 额外备注 | ||
# [extra] | ||
# require_windows = true | ||
# missing_version = "" | ||
# weekly = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Ok, Result } from "ts-results"; | ||
import { ScraperReturned } from "../../src/class"; | ||
|
||
export default async function (): Promise<Result<ScraperReturned, string>> { | ||
const request: any = await fetch( | ||
"https://yun.139.com/platformInfo/advertapi/adv-filter/adv-filter/AdInfoFilter/getAdInfos", | ||
{ | ||
method: "POST", | ||
body: JSON.stringify({ | ||
adpostid: 2016, | ||
}), | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}, | ||
); | ||
const data = await request.json(); | ||
const version = data.body | ||
.find((item: any) => item.name === "Windows") | ||
.description.match(/V([\d.]+)/)[1]; | ||
const downloadLink = data.body.find( | ||
(item: any) => item.name === "Windows", | ||
).adLink; | ||
return new Ok({ | ||
version, | ||
downloadLink, | ||
}); | ||
} |