# xunlei_api **Repository Path**: indsvr/xunlei_api ## Basic Information - **Project Name**: xunlei_api - **Description**: 学习java语言时突发灵动,如有侵犯你的利益 请联系我删除仓库 - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-20 - **Last Updated**: 2025-09-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 迅雷下载的API程序 ## 部署命令 docker compose services: indsvrdownload: container_name: indsvrdownload #镜像名 image: indsvrdownload:2 #网络模式 # network_mode: host #环境变量 environment: - indsvr_download_port=服务端口 - indsvr_download_xunlei_url=迅雷服务地址;docker版本(http://迅雷的IP端口/webman/3rdparty/pan-xunlei-com/index.cgi) 极空间(http://迅雷的IP端口) - indsvr_download_xunlei_device_space= docker版本留空,极空间填写管理员账户 - indsvr_download_token=配套浏览器插件的访问密钥 #重启模式 restart: always ## 浏览器访问地址 http://ip:端口 ## 浏览器插件获取地址 http://ip:端口/plugin ## 接口约定 1.接口调用需在header内携带token 2.所有请求post 3.请求示例 curl示例: curl --location --request GET 'http://10.10.10.2:50015/statusTask' --header 'token: xxxxx' js示例: var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { console.log(this.responseText); } }); xhr.open("GET", "http://10.10.10.2:50015/statusTask"); xhr.setRequestHeader("token", "xxxx"); xhr.send(); java示例: OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, ""); Request request = new Request.Builder() .url("http://10.10.10.2:50015/statusTask") .method("GET", body) .addHeader("token", "xxxxx") .build(); Response response = client.newCall(request).execute(); ## 详细接口 ### 1.增加下载任务 路径:/addTask 参数: { id:"存储路径ID,从查询路径接口获取", url:"下载url" } ### 2.删除下载任务 路径:/delTask 参数: { id:"任务id,查看进度 或 查看历史 接口中获取" } ### 3.暂停下载任务 路径:/stopTask 参数: { id:"任务id,查看进度 或 查看历史 接口中获取" } ### 4.恢复下载任务 路径:/startTask 参数: { id:"任务id,查看进度 或 查看历史 接口中获取" } ### 5.查看进度 路径:/statusTask 参数:无 ### 6.查看历史 路径:/historyTask 参数:无 ### 7.查询路径 路径:/selectPath 参数: { id:"路径id,本接口中获取,传“”时返回根路径信息" } ### 8.创建路径 路径:/insertPath 参数: { id:"路径id", dir:"新增文件夹名称" }