-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
增加WinGet爬虫模板 #137
Comments
应该不需要这么麻烦吧,winget 也是把 manifest 存 GitHub 仓库里面的,是不是用这种路径就 OK 了:https://github.com/microsoft/winget-pkgs/blob/master/manifests/7/7zip/7zip/24.08/7zip.7zip.installer.yaml |
这种方式的话无需Github Token来获取版本号,而且最终获取的Manifest是Singleton Mode,无需手动合并 这里有代码可以参考: https://github.com/ustclug/ustcmirror-images/tree/master/winget-source |
补充一下,第 5 步那个接口返回的 .mszyml 是经过 MSZIP 压缩的 YAML,上面提供的那个仓库里面有 decode 的方法 |
发现个坑,WinGet服务器返回的 YAML 中 PackageVersion 数据类型需要注意一下。 比如:https://cdn.winget.microsoft.com/cache/manifests/g/GPSoftware/DirectoryOpus/13.10/d1cb GitHub 中有双引号,返回配置文件里面无,部分 YAML 库会将无引号的版本号识别成小数,导致版本识别错误,如这里的 13.10 会识别成 13.1。 不清楚 Typescript 中会不会像这样。 |
类似 Scoop 爬虫模板,增加 WinGet 爬虫模板
实现思路:
指定
PackageId
参数下载:
https://cdn.winget.microsoft.com/cache/source2.msix
并解压加载数据库:
\Public\index.db
从数据库中获取对应
PackageId
的hash
获取软件版本信息:
https://cdn.winget.microsoft.com/cache/packages/${PackageId}/${hex.toString()}/versionData.mszyml
Version
:YAML.version.v
RelativePath
:YAML.version.rP
进一步获取该版本的软件下载地址等信息:
https://cdn.winget.microsoft.com/cache/${RelativePath}
The text was updated successfully, but these errors were encountered: