Pinterest拒绝Google App Engine的访问(403) [英] Pinterest denying access from Google App Engine (403)

查看:238
本文介绍了Pinterest拒绝Google App Engine的访问(403)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用oauth accessToken,我可以通过以下方式检索用户的信息:

  https://api.pinterest。 com / v1 / me /?fields = first_name%2Cid%2Clast_name%2Curl%2Cusername%2Cimage& access_token = xxxx 



  {
data:{
用户名:yyyt,
first_name:yyyr,
last_name:,
url:https:\ / \ / www。 pinterest.com\ / yyyt\ /,
image:{
60x60:{
url:https:\ / \ / s-passets -cache-ak0.pinimg.com\/ images\/user\/default_60.png,
width:60,
height:60
}
},
id:1234567890
}
}

然而,当相同的查询由appengine创建时,会返回403错误的详细信息:

  {
消息:禁止,
状态:403

我找不到任何关于为什么Google AppEngine可能会被封锁的信息,他们的API已经发布了Beta版,我不确定它会是什么原因。



以前的问题: Pinterest API - 在EC2实例上返回403提示他们阻止了ec2,因为api仍然非正式地得到支持,但是ec2访问事实上现在看起来不错,所以我不确定他们为什么会阻止谷歌。



任何人都可以提出一个不涉及代理的解决方法,或者向我推荐访问可能被禁止的原因?

或向我介绍访问可能被禁止的原因?


不幸的是,当我试图通过App Engine访问Pinterest网站(而不是API)时,我遇到了同样的问题。



由Pinterest发送的HTTP请求返回的403错误页面似乎是因为Pinterest不喜欢漫游器并故意拒绝App Engine或App Engine开发服务器的HTTP请求。



当试图通过CURL访问Pinterest时,我注意到Pinterest拒绝了<$ c $中包含字符串 App Engine 的所有HTTP请求c> User-Agent HTTP请求标头,但Pinterest很乐意接受任何其他(随机)用户代理字符串。

由于应用程序E如文档中所述,ngine会自动附加字符串AppEngine-Google(+ http://code.google.com/appengine; appid:APPID) User-Agent HTTP请求标头,我怀疑没有办法绕过这个。


Using an oauth accessToken, I am able to retrieve the user's info through:

https://api.pinterest.com/v1/me/?fields=first_name%2Cid%2Clast_name%2Curl%2Cusername%2Cimage&access_token=xxxx

which from a desktop or even ec2 returns:

{
   "data": {
   "username": "yyyt",
   "first_name": "yyyr",
   "last_name": "",
   "url": "https:\/\/www.pinterest.com\/yyyt\/",
   "image": {
      "60x60": {
        "url": "https:\/\/s-passets-cache-ak0.pinimg.com\/images\/user\/default_60.png",
        "width": 60,
        "height": 60
      }
    },
    "id": "1234567890"
  }
}

However, when the same query is made from appengine, a 403 error is returned with the details:

{
    "message": "Forbidden",
    "status": 403
}

I can't find any information about why Google AppEngine may be specifically blocked, and since their API has come out of Beta, I'm not sure a reason why it would be.

This earlier question: Pinterest API - returning 403 on EC2 Instance suggested that they were blocking ec2 because the api was still unofficially supported, but ec2 access does in fact seem fine now, so I'm not sure why they would block google.

Can anyone suggest a workaround not involving a proxy, or refer me to a reason why the access might be forbidden?

解决方案

or refer me to a reason why the access might be forbidden?

Unfortunately I ran into the same issue today when I tried to access the Pinterest web-site (not the API) via App Engine.

Looking at the 403 error page that is returned by Pinterest following a HTTP request from App Engine it seems that the reason is that Pinterest doesn't like bots and intentionally rejects HTTP requests by App Engine or the App Engine dev server.

When trying to access Pinterest via CURL, I noticed that Pinterest rejects all HTTP requests that have the string App Engine in the User-Agent HTTP request header, but Pinterest does happily accept any other (random) User-Agent string.

Because App Engine, as stated in the documentation, automatically appends the string "AppEngine-Google (+http://code.google.com/appengine; appid: APPID)" to the User-Agent HTTP request header, I suspect there is no way of circumventing this.

这篇关于Pinterest拒绝Google App Engine的访问(403)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆