Xget URL 转换规则详解
概述
Xget 使用简单直观的 URL 转换规则,只需替换域名并添加平台前缀即可实现加速。本文档详细介绍了所有支持平台的 URL 转换规则。
基本转换格式
转换公式
1 | 原始 URL: https://platform.com/path/to/resource |
转换步骤
- 识别平台:确定原始 URL 所属平台
- 查找前缀:找到对应的平台前缀
- 替换域名:将原始域名替换为 Xget 域名
- 添加前缀:在路径前添加平台前缀
平台前缀对照表
| 平台 | 平台前缀 | 原始域名 | 支持类型 |
|---|---|---|---|
| GitHub | gh | github.com | 代码、Git |
| GitHub Gist | gist | gist.github.com | 代码片段 |
| GitLab | gl | gitlab.com | 代码、Git |
| Gitea | gitea | gitea.com | 代码、Git |
| Codeberg | codeberg | codeberg.org | 代码、Git |
| SourceForge | sf | sourceforge.net | 软件 |
| AOSP | aosp | android.googlesource.com | 代码、Git |
| Hugging Face | hf | huggingface.co | 模型、数据集 |
| Civitai | civitai | civitai.com | AI 模型 |
| npm | npm | registry.npmjs.org | 包管理 |
| PyPI | pypi | pypi.org | 包管理 |
| conda | conda | repo.anaconda.com | 包管理 |
| Maven | maven | repo1.maven.org | 包管理 |
| Apache | apache | downloads.apache.org | 软件 |
| Gradle | gradle | plugins.gradle.org | 包管理 |
| Homebrew | homebrew | github.com/Homebrew | 包管理 |
| RubyGems | rubygems | rubygems.org | 包管理 |
| CRAN | cran | cran.r-project.org | 包管理 |
| CPAN | cpan | www.cpan.org | 包管理 |
| CTAN | ctan | tug.ctan.org | 包管理 |
| Go 模块 | golang | proxy.golang.org | 包管理 |
| NuGet | nuget | api.nuget.org | 包管理 |
| Rust Crates | crates | crates.io | 包管理 |
| Packagist | packagist | repo.packagist.org | 包管理 |
| Debian | debian | deb.debian.org | 系统包 |
| Ubuntu | ubuntu | archive.ubuntu.com | 系统包 |
| Fedora | fedora | dl.fedoraproject.org | 系统包 |
| Rocky Linux | rocky | download.rockylinux.org | 系统包 |
| openSUSE | opensuse | download.opensuse.org | 系统包 |
| Arch Linux | arch | geo.mirror.pkgbuild.com | 系统包 |
| arXiv | arxiv | arxiv.org | 论文 |
| F-Droid | fdroid | f-droid.org | 应用 |
| Jenkins 插件 | jenkins | updates.jenkins.io | 插件 |
| 容器注册表 | cr | 多个 | 容器镜像 |
| AI 推理提供商 | ip | 多个 | AI 推理 |
各平台转换详解
代码托管平台
GitHub
平台前缀:gh
原始 URL 格式:
1 | https://github.com/{owner}/{repo}/path/to/file |
加速 URL 格式:
1 | https://xget.xi-xu.me/gh/{owner}/{repo}/path/to/file |
转换示例:
下载压缩包
1
2原始: https://github.com/microsoft/vscode/archive/refs/heads/main.zip
加速: https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip下载 Release 文件
1
2原始: https://github.com/nodejs/node/releases/download/v20.10.0/node-v20.10.0-x64.msi
加速: https://xget.xi-xu.me/gh/nodejs/node/releases/download/v20.10.0/node-v20.10.0-x64.msiGit Clone
1
2原始: https://github.com/microsoft/vscode.git
加速: https://xget.xi-xu.me/gh/microsoft/vscode.git
特殊说明:
- 支持 Git 协议完整操作(clone、push、pull、fetch)
- 支持 Git LFS 大文件传输
- 自动识别 Git 端点并配置专用请求头
GitHub Gist
平台前缀:gist
原始 URL 格式:
1 | https://gist.github.com/{username}/{gist-id}/path/to/file |
加速 URL 格式:
1 | https://xget.xi-xu.me/gist/{username}/{gist-id}/path/to/file |
转换示例:
1 | 原始: https://gist.github.com/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md |
GitLab
平台前缀:gl
原始 URL 格式:
1 | https://gitlab.com/{owner}/{repo}/path/to/file |
加速 URL 格式:
1 | https://xget.xi-xu.me/gl/{owner}/{repo}/path/to/file |
转换示例:
1 | 原始: https://gitlab.com/gitlab-org/gitlab/-/archive/master/gitlab-master.zip |
特殊说明:
- GitLab 使用
/-/分隔符,保持原样 - 支持 Git 协议完整操作
Gitea
平台前缀:gitea
原始 URL 格式:
1 | https://gitea.com/{owner}/{repo}/path/to/file |
加速 URL 格式:
1 | https://xget.xi-xu.me/gitea/{owner}/{repo}/path/to/file |
转换示例:
1 | 原始: https://gitea.com/gitea/gitea/archive/master.zip |
Codeberg
平台前缀:codeberg
原始 URL 格式:
1 | https://codeberg.org/{owner}/{repo}/path/to/file |
加速 URL 格式:
1 | https://xget.xi-xu.me/codeberg/{owner}/{repo}/path/to/file |
转换示例:
1 | 原始: https://codeberg.org/forgejo/forgejo/archive/forgejo.zip |
SourceForge
平台前缀:sf
原始 URL 格式:
1 | https://sourceforge.net/projects/{project}/files/{path}/download |
加速 URL 格式:
1 | https://xget.xi-xu.me/sf/projects/{project}/files/{path}/download |
转换示例:
1 | 原始: https://sourceforge.net/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download |
AOSP (Android 开源项目)
平台前缀:aosp
原始 URL 格式:
1 | https://android.googlesource.com/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/aosp/{path} |
转换示例:
AOSP 项目
1
2原始: https://android.googlesource.com/platform/frameworks/base
加速: https://xget.xi-xu.me/aosp/platform/frameworks/baseAOSP 设备树
1
2原始: https://android.googlesource.com/device/google/pixel
加速: https://xget.xi-xu.me/aosp/device/google/pixel
AI/ML 平台
Hugging Face
平台前缀:hf
原始 URL 格式:
1 | https://huggingface.co/{type}/{owner}/{model}/resolve/main/{file} |
加速 URL 格式:
1 | https://xget.xi-xu.me/hf/{type}/{owner}/{model}/resolve/main/{file} |
转换示例:
模型文件
1
2原始: https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin
加速: https://xget.xi-xu.me/hf/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin数据集文件
1
2原始: https://huggingface.co/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet
加速: https://xget.xi-xu.me/hf/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet
特殊说明:
- 支持
models和datasets两种类型 - 支持大文件分片下载
- 自动处理 Hugging Face 的认证
Civitai
平台前缀:civitai
原始 URL 格式:
1 | https://civitai.com/api/{version}/{endpoint} |
加速 URL 格式:
1 | https://xget.xi-xu.me/civitai/api/{version}/{endpoint} |
转换示例:
模型下载
1
2原始: https://civitai.com/api/download/models/128713
加速: https://xget.xi-xu.me/civitai/api/download/models/128713模型 API
1
2原始: https://civitai.com/api/v1/models/7240
加速: https://xget.xi-xu.me/civitai/api/v1/models/7240模型版本 API
1
2原始: https://civitai.com/api/v1/model-versions/128713
加速: https://xget.xi-xu.me/civitai/api/v1/model-versions/128713
包管理平台
npm
平台前缀:npm
原始 URL 格式:
1 | https://registry.npmjs.org/{package}/-/{package}-{version}.tgz |
加速 URL 格式:
1 | https://xget.xi-xu.me/npm/{package}/-/{package}-{version}.tgz |
转换示例:
包文件
1
2原始: https://registry.npmjs.org/react/-/react-18.2.0.tgz
加速: https://xget.xi-xu.me/npm/react/-/react-18.2.0.tgz包元数据
1
2原始: https://registry.npmjs.org/lodash
加速: https://xget.xi-xu.me/npm/lodash
PyPI
平台前缀:pypi
原始 URL 格式:
1 | https://pypi.org/packages/{type}/{package[0]}/{package}/{package}-{version}.{ext} |
加速 URL 格式:
1 | https://xget.xi-xu.me/pypi/packages/{type}/{package[0]}/{package}/{package}-{version}.{ext} |
转换示例:
源码包
1
2原始: https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz
加速: https://xget.xi-xu.me/pypi/packages/source/r/requests/requests-2.31.0.tar.gzWheel 文件
1
2原始: https://pypi.org/packages/py3/n/numpy/numpy-1.26.2-cp312-cp312-win_amd64.whl
加速: https://xget.xi-xu.me/pypi/packages/py3/n/numpy/numpy-1.26.2-cp312-cp312-win_amd64.whl
conda
平台前缀:conda
原始 URL 格式:
1 | https://repo.anaconda.com/pkgs/{channel}/{package} |
加速 URL 格式:
1 | https://xget.xi-xu.me/conda/pkgs/{channel}/{package} |
转换示例:
主仓库
1
2原始: https://repo.anaconda.com/pkgs/main/win-64/python-3.11.0-h955f1ad_0.conda
加速: https://xget.xi-xu.me/conda/pkgs/main/win-64/python-3.11.0-h955f1ad_0.conda社区仓库
1
2原始: https://conda.anaconda.org/conda-forge/win-64/pytorch-2.1.0-py311_cuda121_cudnn8_0.tar.bz2
加速: https://xget.xi-xu.me/conda/community/conda-forge/win-64/pytorch-2.1.0-py311_cuda121_cudnn8_0.tar.bz2
Maven
平台前缀:maven
原始 URL 格式:
1 | https://repo1.maven.org/maven2/{group}/{artifact}/{version}/{artifact}-{version}.{ext} |
加速 URL 格式:
1 | https://xget.xi-xu.me/maven2/{group}/{artifact}/{version}/{artifact}-{version}.{ext} |
转换示例:
1 | 原始: https://repo1.maven.org/maven2/org/springframework/spring-core/6.1.1/spring-core-6.1.1.jar |
Gradle
平台前缀:gradle
原始 URL 格式:
1 | https://plugins.gradle.org/m2/{group}/{artifact}/{version}/{artifact}-{version}.{ext} |
加速 URL 格式:
1 | https://xget.xi-xu.me/gradle/m2/{group}/{artifact}/{version}/{artifact}-{version}.{ext} |
转换示例:
1 | 原始: https://plugins.gradle.org/m2/com/github/ben-manes/gradle-caches-plugin/0.9.0/gradle-caches-plugin-0.9.0.pom |
Homebrew
平台前缀:homebrew
原始 URL 格式:
1 | https://github.com/Homebrew/{repo}/archive/refs/tags/{tag}.tar.gz |
加速 URL 格式:
1 | https://xget.xi-xu.me/homebrew/{repo}/archive/refs/tags/{tag}.tar.gz |
转换示例:
1 | 原始: https://github.com/Homebrew/brew/archive/refs/tags/4.2.0.tar.gz |
RubyGems
平台前缀:rubygems
原始 URL 格式:
1 | https://rubygems.org/gems/{gem}-{version}.gem |
加速 URL 格式:
1 | https://xget.xi-xu.me/rubygems/gems/{gem}-{version}.gem |
转换示例:
1 | 原始: https://rubygems.org/gems/rails-7.1.2.gem |
CRAN ®
平台前缀:cran
原始 URL 格式:
1 | https://cran.r-project.org/src/contrib/{package}_{version}.tar.gz |
加速 URL 格式:
1 | https://xget.xi-xu.me/cran/src/contrib/{package}_{version}.tar.gz |
转换示例:
1 | 原始: https://cran.r-project.org/src/contrib/ggplot2_3.4.4.tar.gz |
CPAN (Perl)
平台前缀:cpan
原始 URL 格式:
1 | https://www.cpan.org/authors/id/{author}/{package}-{version}.tar.gz |
加速 URL 格式:
1 | https://xget.xi-xu.me/cpan/authors/id/{author}/{package}-{version}.tar.gz |
转换示例:
1 | 原始: https://www.cpan.org/authors/id/M/MI/MIYAGAWA/Plack-1.050.tar.gz |
CTAN (TeX/LaTeX)
平台前缀:ctan
原始 URL 格式:
1 | https://tug.ctan.org/tex-archive/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/ctan/tex-archive/{path} |
转换示例:
1 | 原始: https://tug.ctan.org/tex-archive/macros/latex/contrib/beamer.zip |
Go 模块
平台前缀:golang
原始 URL 格式:
1 | https://proxy.golang.org/{module}/@v/{version}.zip |
加速 URL 格式:
1 | https://xget.xi-xu.me/golang/{module}/@v/{version}.zip |
转换示例:
1 | 原始: https://proxy.golang.org/github.com/golang/go/@v/v1.21.5.zip |
NuGet (.NET)
平台前缀:nuget
原始 URL 格式:
1 | https://api.nuget.org/v3-flatcontainer/{package}/{version}/{package}.{version}.nupkg |
加速 URL 格式:
1 | https://xget.xi-xu.me/nuget/v3-flatcontainer/{package}/{version}/{package}.{version}.nupkg |
转换示例:
1 | 原始: https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg |
Rust Crates
平台前缀:crates
原始 URL 格式:
1 | https://crates.io/api/v1/crates/{crate}/{version}/download |
加速 URL 格式:
1 | https://xget.xi-xu.me/crates/api/v1/crates/{crate}/{version}/download |
转换示例:
1 | 原始: https://crates.io/api/v1/crates/serde/1.0.195/download |
Packagist (PHP)
平台前缀:packagist
原始 URL 格式:
1 | https://repo.packagist.org/p/{vendor}/{package}.json |
加速 URL 格式:
1 | https://xget.xi-xu.me/packagist/p/{vendor}/{package}.json |
转换示例:
1 | 原始: https://repo.packagist.org/p/laravel/framework.json |
系统包管理平台
Debian
平台前缀:debian
原始 URL 格式:
1 | https://deb.debian.org/debian/{pool}/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/debian/{pool}/{path} |
转换示例:
1 | 原始: https://deb.debian.org/debian/pool/main/n/nginx/nginx_1.25.3-1_amd64.deb |
Ubuntu
平台前缀:ubuntu
原始 URL 格式:
1 | https://archive.ubuntu.com/ubuntu/{pool}/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/ubuntu/{pool}/{path} |
转换示例:
1 | 原始: https://archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_8.4.0-2ubuntu1_amd64.deb |
Fedora
平台前缀:fedora
原始 URL 格式:
1 | https://dl.fedoraproject.org/pub/fedora/linux/releases/{version}/Everything/{arch}/os/Packages/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/fedora/linux/releases/{version}/Everything/{arch}/os/Packages/{path} |
转换示例:
1 | 原始: https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.25.3-1.fc39.x86_64.rpm |
Rocky Linux
平台前缀:rocky
原始 URL 格式:
1 | https://download.rockylinux.org/pub/rocky/{version}/BaseOS/{arch}/os/Packages/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/rocky/{version}/BaseOS/{arch}/os/Packages/{path} |
转换示例:
1 | 原始: https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/n/nginx-1.20.1-14.el9_2.1.x86_64.rpm |
openSUSE
平台前缀:opensuse
原始 URL 格式:
1 | https://download.opensuse.org/{distribution}/repo/{repo}/{arch}/{package}.rpm |
加速 URL 格式:
1 | https://xget.xi-xu.me/opensuse/{distribution}/repo/{repo}/{arch}/{package}.rpm |
转换示例:
1 | 原始: https://download.opensuse.org/tumbleweed/repo/oss/x86_64/nginx-1.25.3-1.1.x86_64.rpm |
Arch Linux
平台前缀:arch
原始 URL 格式:
1 | https://geo.mirror.pkgbuild.com/{repo}/os/{arch}/{package}.pkg.tar.zst |
加速 URL 格式:
1 | https://xget.xi-xu.me/arch/{repo}/os/{arch}/{package}.pkg.tar.zst |
转换示例:
1 | 原始: https://geo.mirror.pkgbuild.com/core/os/x86_64/nginx-1.25.3-1-x86_64.pkg.tar.zst |
其他平台
arXiv
平台前缀:arxiv
原始 URL 格式:
1 | https://arxiv.org/pdf/{paper-id}.pdf |
加速 URL 格式:
1 | https://xget.xi-xu.me/arxiv/pdf/{paper-id}.pdf |
转换示例:
1 | 原始: https://arxiv.org/pdf/2312.12345.pdf |
F-Droid
平台前缀:fdroid
原始 URL 格式:
1 | https://f-droid.org/repo/{path} |
加速 URL 格式:
1 | https://xget.xi-xu.me/fdroid/repo/{path} |
转换示例:
1 | 原始: https://f-droid.org/repo/com.example.app_100.apk |
Jenkins 插件
平台前缀:jenkins
原始 URL 格式:
1 | https://updates.jenkins.io/latest/{plugin}.hpi |
加速 URL 格式:
1 | https://xget.xi-xu.me/jenkins/latest/{plugin}.hpi |
转换示例:
1 | 原始: https://updates.jenkins.io/latest/git.hpi |
Apache 软件下载
平台前缀:apache
原始 URL 格式:
1 | https://downloads.apache.org/{project}/{file} |
加速 URL 格式:
1 | https://xget.xi-xu.me/apache/{project}/{file} |
转换示例:
1 | 原始: https://downloads.apache.org/tomcat/tomcat-10/v10.1.15/bin/apache-tomcat-10.1.15.tar.gz |
容器注册表
平台前缀:cr
支持的注册表:
- Docker Hub (
docker.io) - GitHub Container Registry (
ghcr.io) - Google Container Registry (
gcr.io) - Azure Container Registry (
azurecr.io) - AWS Elastic Container Registry (
public.ecr.aws) - Quay.io (
quay.io)
原始 URL 格式:
1 | https://{registry}/v2/{image}/manifests/{tag} |
加速 URL 格式:
1 | https://xget.xi-xu.me/cr/{registry}/{image}/manifests/{tag} |
转换示例:
Docker Hub
1
2原始: https://registry-1.docker.io/v2/library/nginx/manifests/latest
加速: https://xget.xi-xu.me/cr/registry-1.docker.io/library/nginx/manifests/latestGitHub Container Registry
1
2原始: https://ghcr.io/v2/user/image/manifests/v1.0
加速: https://xget.xi-xu.me/cr/ghcr.io/user/image/manifests/v1.0
AI 推理提供商
平台前缀:ip
支持的提供商:
- OpenAI (
api.openai.com) - Anthropic (
api.anthropic.com) - Google AI (
generativelanguage.googleapis.com) - 其他兼容 OpenAI API 的服务
原始 URL 格式:
1 | https://{provider}/v1/{endpoint} |
加速 URL 格式:
1 | https://xget.xi-xu.me/ip/{provider}/v1/{endpoint} |
转换示例:
OpenAI
1
2原始: https://api.openai.com/v1/chat/completions
加速: https://xget.xi-xu.me/ip/api.openai.com/v1/chat/completionsAnthropic
1
2原始: https://api.anthropic.com/v1/messages
加速: https://xget.xi-xu.me/ip/api.anthropic.com/v1/messages
URL 转换器
为了简化 URL 转换过程,Xget 提供了在线 URL 转换器:
使用方法
- 访问 xuc.xi-xu.me
- 粘贴原始 URL
- 点击转换按钮
- 获取加速 URL
功能特性
- 自动识别平台
- 一键转换 URL
- 支持批量转换
- 复制到剪贴板
注意事项
1. 大小写敏感
- 平台前缀必须小写
- 路径保持原始大小写
2. 特殊字符
- URL 中的特殊字符需要正确编码
- 查询参数保持原样
3. Git 操作
- Git 操作使用相同的转换规则
- 自动识别 Git 端点
- 支持
.git后缀
4. 认证信息
- 不支持在 URL 中传递认证信息
- 使用环境变量或配置文件
5. 自定义域名
- 可以使用自己部署的 Xget 实例
- 替换
xget.xi-xu.me为你的域名
常见问题
Q1: 如何验证转换后的 URL 是否正确?
A: 访问转换后的 URL,如果返回预期的内容,说明转换正确。
Q2: 转换后的 URL 可以在浏览器中直接访问吗?
A: 可以,但某些平台可能需要特定的请求头,建议使用对应的工具。
Q3: 支持自定义平台吗?
A: 可以通过修改配置文件添加自定义平台。
Q4: 转换后的 URL 会失效吗?
A: 不会,只要 Xget 实例正常运行,转换后的 URL 持续有效。
Q5: 如何批量转换多个 URL?
A: 使用在线转换器的批量转换功能,或编写脚本进行批量转换。
总结
Xget 的 URL 转换规则简单直观,只需:
- 替换域名为 Xget 域名
- 在路径前添加平台前缀
- 保持原始路径不变
通过这种简单的转换规则,Xget 为 40+ 开发者常用平台提供了统一的加速服务。