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

Ascii2d 报错403 似乎是因为触发cf引起 #13

Closed
Coder-Sakura opened this issue Jan 9, 2022 · 4 comments
Closed

Ascii2d 报错403 似乎是因为触发cf引起 #13

Coder-Sakura opened this issue Jan 9, 2022 · 4 comments

Comments

@Coder-Sakura
Copy link

使用本地图片或网络图片都是一样的结果。可以参考cq-picsearcher-bot项目的issue

运行截图
image

@Ansbot
Copy link

Ansbot commented Jan 10, 2022

试了下,换掉header里面的ua就行了:
ascci2d

@Coder-Sakura
Copy link
Author

试了下,换掉header里面的ua就行了: ascci2d

先说下我之前的情况。

  • Postman及浏览器均可访问,使用python编写脚本无法访问(包括获取首页的csrf_token)

今天我使用了cloudscraper这个库来跳过CF 5秒盾的,甚至不带headers都可以访问,终于看到的不是可恶的403了

url = "https://ascii2d.net/search/url/http://5b0988e595225.cdn.sohucs.com/images/20200109/74e33947a41248839725d6c8d54540e4.jpeg"
headers= {}
payload = {}

# Use CloudScrpaer
import cloudscraper
scraper = cloudscraper.create_scraper()
response = scraper.get(url, headers=headers, data = payload)

# Not Use CloudScrpaer
print("\n")
response = requests.request("GET", url, headers=headers, data = payload)

image

@Ansbot
Copy link

Ansbot commented Jan 10, 2022

试了下,换掉header里面的ua就行了: ascci2d

先说下我之前的情况。

  • Postman及浏览器均可访问,使用python编写脚本无法访问(包括获取首页的csrf_token)

今天我使用了cloudscraper这个库来跳过CF 5秒盾的,甚至不带headers都可以访问,终于看到的不是可恶的403了

url = "https://ascii2d.net/search/url/http://5b0988e595225.cdn.sohucs.com/images/20200109/74e33947a41248839725d6c8d54540e4.jpeg"
headers= {}
payload = {}

# Use CloudScrpaer
import cloudscraper
scraper = cloudscraper.create_scraper()
response = scraper.get(url, headers=headers, data = payload)

# Not Use CloudScrpaer
print("\n")
response = requests.request("GET", url, headers=headers, data = payload)

image

挺好,可惜js类似的库不更新了,不然隔壁cq-picsearcher-bot也可以用

@kitUIN
Copy link
Owner

kitUIN commented Jan 10, 2022

感谢提供解决方法🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants