-
Notifications
You must be signed in to change notification settings - Fork 149
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
ByPassSniApi示例中api.auth方法报错 #279
Comments
现在手动指定headers也不行了 有解决思路吗 |
应该是2个不同的问题。第一个指定Host可能是检查,解析的IP是正确的:
而后面这个是因为解析到的地址无法访问,或者解析失败用了域名。你可以分步检查下是否拿到IP,以及IP是否能访问 |
#138(commit) 是否问题与此相同? 可尝试修改host或调用api.require_appapi_hosts(hostname="public-api.secure.pixiv.net")) |
第二个好像是我自己开的代理被SSL拦截了 指定host之后是可以的 |
试了下,确实这个方法可以绕过(代码如下)。推测是默认 app-api.pixiv.net 指向IP不支持SSL,换成 app-api.secure.pixiv.net 的域名解析IP就可以: def main():
api = ByPassSniApi()
# 主要改动
api.require_appapi_hosts(hostname="app-api.secure.pixiv.net")
print(api.auth(refresh_token=_REFRESH_TOKEN))
json_result = api.illust_ranking("day", date=(datetime.now() - timedelta(days=5)).strftime("%Y-%m-%d")) 下个版本我更新到BAPI的默认host上 |
fixed in 50b9cb8 |
pixivpy3版本:3.7.2
报错信息:
pixivpy3.utils.PixivError: requests POST https://210.140.92.183/auth/token error: HTTPSConnectionPool(host='210.140.92.183', port=443): Max retries exceeded with url: /auth/token (Caused by SSLError(CertificateError("hostname '210.140.92.183' doesn't match either of '.pixiv.net', 'pixiv.me', 'public-api.secure.pixiv.net', 'oauth.secure.pixiv.net', 'www.pixivision.net', 'fanbox.cc', '.fanbox.cc', 'pixiv.net'")))
报错代码如下
当手动指定请求头host后,工作正常
auth函数中与该逻辑有关的代码似乎如下
是否在requests_call中传入的headers参数错误?
The text was updated successfully, but these errors were encountered: