Skip to content
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

群晖7.1.1 Synology Download Station下载报错 #1139

Closed
261032568 opened this issue Oct 14, 2022 · 19 comments
Closed

群晖7.1.1 Synology Download Station下载报错 #1139

261032568 opened this issue Oct 14, 2022 · 19 comments
Labels
bug Something isn't working

Comments

@261032568
Copy link

261032568 commented Oct 14, 2022

  • PT 助手版本:v1.5.2.99ab2de zip
  • PT 助手安装方式:zip(市场安装,或zip包安装)
  • 浏览器名称及版本:Microsoft Edge
  • 浏览器是否安装了其他插件:是
  • 停用其他插件后是否正常工作:否
  • 问题描述:
    background | service.controller.doDownload.error | 2022-10-14 11:35:14 | 下载服务器Synology Download Station处理[addTorrentFromURL]命令失败!
    -- | -- | -- | -- | --
    {"error":{"code":119},"success":false}

DSM系统版本是7.1.1,下载服务器连接正常,下载是报错,7.1升级到7.1.1后才出现这个问题

  • 相关截图:

截屏2022-10-14 11 44 35

@261032568 261032568 added the bug Something isn't working label Oct 14, 2022
@ted423
Copy link
Collaborator

ted423 commented Oct 14, 2022

在这里讨论吧 #687

@ted423 ted423 closed this as completed Oct 14, 2022
@ted423 ted423 reopened this Oct 14, 2022
@ted423 ted423 closed this as completed Oct 14, 2022
@261032568
Copy link
Author

261032568 commented Oct 14, 2022 via email

@ted423
Copy link
Collaborator

ted423 commented Oct 15, 2022

请去我提供的那个issue里讨论,再已有issue open的情况下,不要新开issue,
一个主题讨论才能确保有效的讨论

@Rhilip
Copy link
Collaborator

Rhilip commented Nov 19, 2022

在这里讨论吧 #687

@ted423 我觉得还是在这个issue中讨论好些, DSM 7.0 的升级已经在 #687 中解决。目前的问题是 7.1 升级到 7.1.1 之后的兼容性被破坏了。
而这个目前无法修,因为我没有demo环境,无法测试到底又是Synology那边哪个参数抽风了。

目前只能建议不要升级到 7.1.1 ,7.1版本应该是可以使用的。

@Rhilip Rhilip reopened this Nov 19, 2022
@Rhilip Rhilip pinned this issue Nov 19, 2022
@tyejuan
Copy link

tyejuan commented Nov 21, 2022

是这样的,现在只差这个DSM7.1.1没法解决了。我准备降级到7.1试一下

@ted423
Copy link
Collaborator

ted423 commented Dec 30, 2022

https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/Calendar/2.4/enu/Synology_Calendar_API_Guide_enu.pdf

我发现我这边的请求有 X-SYNO-HASH 和 X-SYNO-TOKEN
然后搜到了这个文档

To avoid CSRF issue, remember to carry X-SYNO-TOKEN in the request headers for any request
with entry.cgi. The X-SYNO-TOKEN value could be acquired by webman/login.cgi. For example:

@ted423
Copy link
Collaborator

ted423 commented Dec 30, 2022

@ted423
Copy link
Collaborator

ted423 commented Dec 30, 2022

POST /webapi/entry.cgi?api=SYNO.API.Auth HTTP/1.1
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5
Connection: keep-alive
Content-Length: 196
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: _SSID=???
DNT: 1
Host: nas.?:5000
Origin: http://nas.?:5000
Referer: http://nas.?:5000/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

这个请求里会有个

{"data":{"kk_message":"???","synotoken":"??"},"success":true}

@ted423
Copy link
Collaborator

ted423 commented Dec 30, 2022

GET /webapi/entry.cgi?api=SYNO.API.Auth&version=6&method=token&_dc=???&SynoToken=???
HTTP/1.1
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5
Connection: keep-alive
Cookie: _SSID=???
DNT: 1
Host: nas.?:5000
Referer: http://nas.?:5000/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
X-Requested-With: XMLHttpRequest
X-SYNO-HASH: ?
X-SYNO-TOKEN: ???

@Mmx88
Copy link

Mmx88 commented Feb 4, 2023

原来没解决,试了好久找不到问题。。。

@sdjnmxd
Copy link
Contributor

sdjnmxd commented Feb 13, 2023

关联PR:#1340
已经合并至dev

@261032568
Copy link
Author

关联PR:#1340 已经合并至dev
现在可以正常使用了,非常感谢!

@ted423 ted423 closed this as completed Feb 14, 2023
@tyejuan
Copy link

tyejuan commented Feb 14, 2023

关联PR:#1340 已经合并至dev
现在可以正常使用了,非常感谢!

我按说明修改了代码,修改了以下三个位置,还是不能添加种子。请问能指点一下吗?
******** * 获取 SID
/
getSessionId() {
return new Promise((resolve, reject) => {
let url = ${this.options.address}/webapi/auth.cgi?api=SYNO.API.Auth&version=3&method=login&account=${encodeURIComponent(this.options.loginName)}&passwd=${encodeURIComponent(this.options.loginPwd)}&session=DownloadStation&format=sid_&enable_syno_token=yes_;
********

*******_sid: this.sessionId // fxxk, _sid 参数不能放在第一位,不然会直接 101 报错
}

 let headers = {
  'X-SYNO-T0KEN': this.synoToken
 }

  // fxxk, 没有 destination 参数也会直接报错
  let savePath = (options.savePath || "") + "";*********

******* addTorrent(formData, options, callback) {
$.ajax({
url: ${this.options.address}/webapi/entry.cgi,
headers,
timeout: PTBackgroundService.options.connectClientTimeout,********

@sdjnmxd
Copy link
Contributor

sdjnmxd commented Feb 14, 2023

关联PR:#1340 已经合并至dev
现在可以正常使用了,非常感谢!

我按说明修改了代码,修改了以下三个位置,还是不能添加种子。请问能指点一下吗? ******** * 获取 SID / getSessionId() { return new Promise((resolve, reject) => { let url = ${this.options.address}/webapi/auth.cgi?api=SYNO.API.Auth&version=3&method=login&account=${encodeURIComponent(this.options.loginName)}&passwd=${encodeURIComponent(this.options.loginPwd)}&session=DownloadStation&format=sid_&enable_syno_token=yes_;********

*******_sid: this.sessionId // fxxk, _sid 参数不能放在第一位,不然会直接 101 报错 }

 let headers = {
  'X-SYNO-T0KEN': this.synoToken
 }

  // fxxk, 没有 destination 参数也会直接报错
  let savePath = (options.savePath || "") + "";*********

******* addTorrent(formData, options, callback) { $.ajax({ url: ${this.options.address}/webapi/entry.cgi, headers, timeout: PTBackgroundService.options.connectClientTimeout,********

为什么不直接基于dev分支构建扩展?
此外修改不止三处,详情请看diff

@261032568
Copy link
Author

关联PR:#1340 已经合并至dev
现在可以正常使用了,非常感谢!

我按说明修改了代码,修改了以下三个位置,还是不能添加种子。请问能指点一下吗? ******** * 获取 SID / getSessionId() { return new Promise((resolve, reject) => { let url = ${this.options.address}/webapi/auth.cgi?api=SYNO.API.Auth&version=3&method=login&account=${encodeURIComponent(this.options.loginName)}&passwd=${encodeURIComponent(this.options.loginPwd)}&session=DownloadStation&format=sid_&enable_syno_token=yes_;********

*******_sid: this.sessionId // fxxk, _sid 参数不能放在第一位,不然会直接 101 报错 }

 let headers = {
  'X-SYNO-T0KEN': this.synoToken
 }

  // fxxk, 没有 destination 参数也会直接报错
  let savePath = (options.savePath || "") + "";*********

******* addTorrent(formData, options, callback) { $.ajax({ url: ${this.options.address}/webapi/entry.cgi, headers, timeout: PTBackgroundService.options.connectClientTimeout,********

需要先清除一下浏览器缓冲,重新载入插件,登陆你的DSM服务器后,再去下载

@sdjnmxd
Copy link
Contributor

sdjnmxd commented Feb 14, 2023

@tyejuan 参考文档直接使用构建好的吧
没必要自己再对着代码改一遍了

@tyejuan
Copy link

tyejuan commented Feb 14, 2023

@tyejuan 参考文档直接使用构建好的吧 没必要自己再对着代码改一遍了

我没找到dev频道的链接,麻烦能发一下吗

@sdjnmxd
Copy link
Contributor

sdjnmxd commented Feb 14, 2023

@tyejuan 参考文档直接使用构建好的吧 没必要自己再对着代码改一遍了

我没找到dev频道的链接,麻烦能发一下吗

这是最新dev分支构建结果:https://github.com/pt-plugins/PT-Plugin-Plus/actions/runs/4164203901
从下面的Artifacts处下载crx或是zip,然后根据文档更新即可

@tyejuan
Copy link

tyejuan commented Feb 14, 2023

@tyejuan 参考文档直接使用构建好的吧 没必要自己再对着代码改一遍了

我没找到dev频道的链接,麻烦能发一下吗

这是最新dev分支构建结果:https://github.com/pt-plugins/PT-Plugin-Plus/actions/runs/4164203901 从下面的Artifacts处下载crx或是zip,然后根据文档更新即可

已能用,非常感谢!Mac版的edge加载扩展也搞定能用。

@ted423 ted423 unpinned this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants