gpt4 book ai didi

javascript - Pinterest 无法获取图像

转载 作者:行者123 更新时间:2023-12-03 11:24:20 26 4
gpt4 key购买 nike

尝试实现“固定它”按钮,但它会为每张图片返回以下问题。我们在整个网站上使用 SSL,我想知道这是否相关。

有什么想法吗?

{"route_pattern": "^/resource/:name/:method/$", "error": {"api_error_code": 1, "message": "Sorry we could not fetch the image.", "code": "API_ERROR", "target": "<webapp.resources.pin_resource.PinResource object at 0xb851c50>", "http_status": 400}, "resource": {"name": "PinResource", "options": {"board_id": "393150311159619967", "description": "Kokeshi - Samoura\u00ef Bento", "link": "https://bentooo.com/products/kokeshi-samourai-bento", "image_url": "https://bentooo.com/upload/pictures/884/thumb/IMG_0704.jpg", "bookmarks": ["-end-"], "is_video": null, "method": "button"}}, "client_context": {"app_version": "5bdef68"}, "resource_response": {"data": null, "error": {"api_error_code": 1, "message": "Sorry we could not fetch the image.", "code": "API_ERROR", "target": "<webapp.resources.pin_resource.PinResource object at 0xb851c50>", "http_status": 400}}}

最佳答案

我们每次都遇到完全相同的问题。还怀疑我们的 .htaccess 文件存在问题,将非 SSL 流量重写为 SSL 流量。

    "resource_response": {
"data": null,
"error": {
"api_error_code": 1,
"message": "Sorry! Something went wrong on our end. Please try again.",
"code": "API_ERROR",
"target": "<webapp.resources.pin_resource.PinResource object at 0x7f0c9b421e50>",
"http_status": 400
}
}

这对我们有用;不确定它是否对其他人有帮助?我们只是更新了 .htaccess 以在 HTTP referer 匹配 *.pinterest.com 的地方包含一个 Rewrite 排除项,然后确保 &media=value 使用非 SSL 模式引用媒体资源。

示例:

RewriteCond %{ENV:siteENV} PROD
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_REFERER} !(?:pinterest.com)
RewriteRule (.*) https://www.somedomain.com%{REQUEST_URI} [L,R=301]

还有密码。请注意非 SSL &media=value。

<a href="//pinterest.com/pin/create/button/?url=https://www.somedomain.com/mypage&media=http://www.somedomain.com/assets/images/myimage.jpg&description=Some%20urlencoded%20description" data-pin-do="buttonPin" data-pin-config="beside">
<img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" />
<img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_red_28.png" />
</a>

关于javascript - Pinterest 无法获取图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18394573/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com