Tsuk1ko / pxder

🖼 Download illusts from pixiv.net P站插画批量下载器
https://moe.best/projects/pxder.html
GNU General Public License v3.0
742 stars 78 forks source link

OAuth输入Code后卡在tokenRequest #58

Closed wwc7654321 closed 3 years ago

wwc7654321 commented 3 years ago

OAuth方式登录后,输入Code后,浏览器又弹出与第一步一模一样的登录页面,再次点击登录后无反应。

代码卡在tokenRequest函数中callApi一直等待 image

Tsuk1ko commented 3 years ago

如果你需要挂代理才能访问 pixiv,别忘了给 pxder 设置代理,或者启用直连模式

wwc7654321 commented 3 years ago

Thanks, 确实与代理有关,https://127.0.0.1:1080 按说明替换成 socks://127.0.0.1:1080即可下载

不过 https://127.0.0.1:1080 在另一个Python脚本中却可以正常工作,有点怪 (获取到refresh_token,直接填到pxder里用了)

image

Tsuk1ko commented 3 years ago

看起来你应当使用 http://127.0.0.1:1080,而不是 https

我猜测这段 python 中的这个代理配置实际等效的应该是

proxies = {
  'http': 'http://127.0.0.1:1080',
  'https': 'http://127.0.0.1:1080'
}

即当请求 http / https 时分别使用这些代理,由于你没有写协议,所以默认 http

wwc7654321 commented 3 years ago

你的意思是一个https请求可以经过http代理吗?这真是没想到,

不过仔细想想倒也没什么问题,代理只是提供一个二进制通道

Tsuk1ko commented 3 years ago

当然是可以的,而且一般代理软件在本地提供的都是 http 和 socks