Skip to content

Commit

Permalink
Merge pull request #143 from xrgzs/feat/add-mcloud
Browse files Browse the repository at this point in the history
feat: add 中国移动云盘
  • Loading branch information
Cnotech authored Oct 23, 2024
2 parents f432612 + 9be70ea commit d8c2ca3
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tasks/中国移动云盘/config.toml
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
28 changes: 28 additions & 0 deletions tasks/中国移动云盘/scraper.ts
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,
});
}

0 comments on commit d8c2ca3

Please sign in to comment.