自5月4日更新以来,我一直遇到onebox预览问题。并非所有超链接都能成功生成预览框。
不过,这些超链接直到今天之前在meta上都运行正常,今天我终于发现了一个在meta上存在类似*问题的超链接。
*错误代码不同
请提供建议。感谢帮助。
https://medium.com/swlh/5-free-python-courses-for-beginners-to-learn-online-e1ca90687caf
自5月4日更新以来,我一直遇到onebox预览问题。并非所有超链接都能成功生成预览框。
不过,这些超链接直到今天之前在meta上都运行正常,今天我终于发现了一个在meta上存在类似*问题的超链接。
*错误代码不同
请提供建议。感谢帮助。
https://medium.com/swlh/5-free-python-courses-for-beginners-to-learn-online-e1ca90687caf
我尝试在论坛上对那个链接进行 Onebox 处理,得到了相同的结果。
我一开始查看该链接时就注意到了这一点。它返回了两个异常。因此该链接无法被 Onebox。这就是你/我们在 Onebox 中看到该消息的原因。
@jamie.wilson 一直在调查中等尺寸 onebox 的问题,我们已有修复方案正在推进中。
是的,这看起来与导致 500 错误的同一个问题。我们是否已解决此问题,@jamie.wilson?
@SkyLin 提供的链接再次触发了 Onebox 功能:
https://medium.com/swlh/5-free-python-courses-for-beginners-to-learn-online-e1ca90687caf
看起来 Medium 方面进行了一些更改,暴露了我们在生成 Onebox 时存在的某些不足。这些问题现已在我们这边得到解决并合并,使 Onebox 功能整体上更加稳健(不仅限于 Medium 平台)。
此问题在更新后已解决。非常感谢!
但我最初的问题*仍然存在。我还能采取什么进一步措施来解决吗?再次感谢。
*Onebox 在 meta 上运行正常,但在我的网站上对同一 URL 却失败了:
我刚刚在你的网站上和 Meta 上测试了你提供的全部 3 个链接(1 个 Medium 链接和 2 个 Udemy 链接)。这 3 个链接在我的网站上和 Meta 上都成功进行了 Onebox 处理。
感谢提供这些信息。
我尝试了 Amazon onebox 在我的网站上失败,但在这里可以工作 中提到的方法,发现访问 Udemy 时返回了 403 错误码。我甚至克隆了一个使用旧备份的 网站,也遇到了同样的问题。我想知道是否还有其他原因导致此问题,例如设置问题?
请给予建议。谢谢帮助。
root@localhost:~# curl https://www.udemy.com/course/certified-kubernetes-application-developer/ -o deleteme.html --verbose
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 2606:4700::6810:4255:443... * TCP_NODELAY set
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0* Connected to www.udemy.com (2606:4700::6810:4255) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [3726 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Udemy, Inc.; CN=*.udemy.com
* start date: Sep 10 15:45:40 2020 GMT
* expire date: Oct 12 15:45:40 2021 GMT
* subjectAltName: host "www.udemy.com" matched cert's "*.udemy.com"
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign RSA OV SSL CA 2018
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55ba70848e10)
} [5 bytes data]
> GET /course/certified-kubernetes-application-developer/ HTTP/2
> Host: www.udemy.com
> user-agent: curl/7.68.0
> accept: */*
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
} [5 bytes data]
< HTTP/2 403
< date: Sat, 15 May 2021 09:15:50 GMT
< content-type: text/plain; charset=UTF-8
< content-length: 16
< x-frame-options: SAMEORIGIN
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< cf-request-id: 0a10e892d400000ac0a696a000000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< set-cookie: __cf_bm=b04492251e1a16bfdad619155f03441f5707d134-1621070150-1800-AS6cROKp+jLfN9ubIJem+TuX5dANVYbshBzqeRTZhheBx6lOtfM8RPRDSGDLEObLD8tWwjbrp+D5Sh4RcCTXGNw=; path=/; expires=Sat, 15-May-21 09:45:50 GMT; domain=.udemy.com; HttpOnly; Secure; SameSite=None
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 64fb4397bea70ac0-NRT
<
{ [16 bytes data]
100 16 100 16 0 0 10 0 0:00:01 0:00:01 --:--:-- 10
* Connection #0 to host www.udemy.com left intact
这从何而来?1970 年?那已经是 50 多年前的事了。
来自以下命令的响应:
curl https://www.udemy.com/course/certified-kubernetes-application-developer/ -o deleteme.html --verbose
以下是亚马逊返回 503 错误代码的响应:
root@localhost:~# curl https://www.amazon.com/Deep-Learning-Python-Francois-Chollet/dp/1617294438 -o deleteme.html --verbose
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 162.219.225.118:443...
* TCP_NODELAY set
* Connected to www.amazon.com (162.219.225.118) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [4447 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=www.amazon.com
* start date: Apr 26 00:00:00 2021 GMT
* expire date: Apr 25 23:59:59 2022 GMT
* subjectAltName: host "www.amazon.com" matched cert's "www.amazon.com"
* issuer: C=US; O=DigiCert Inc; CN=DigiCert Global CA G2
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55993f5fae10)
} [5 bytes data]
> GET /Deep-Learning-Python-Francois-Chollet/dp/1617294438 HTTP/2
> Host: www.amazon.com
> user-agent: curl/7.68.0
> accept: */*
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [177 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
} [5 bytes data]
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
< HTTP/2 503
< server: Server
< date: Mon, 17 May 2021 01:37:18 GMT
< content-type: text/html
< strict-transport-security: max-age=47474747; includeSubDomains; preload
< x-amz-rid: 72RYS75V0EMTMX4RK38T
< vary: Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent
< last-modified: Wed, 30 Sep 2020 23:54:00 GMT
< etag: "a6f-5b0909d09d600"
< accept-ranges: bytes
< content-length: 2671
<
{ [1139 bytes data]
100 2671 100 2671 0 0 3604 0 --:--:-- --:--:-- --:--:-- 3599
* Connection #0 to host www.amazon.com left intact
root@localhost:~#
另外,在 Jamie 更新代码后,亚马逊的 onebox 预览现在正常了。更新前的预览效果请参考下图:
亚马逊链接做得不错。Udemy 的链接现在能正常访问了吗,还是仍然返回 403 错误?我这边直接预览这些链接一直没问题。
再次感谢。
我网站上的所有 Udemy 超链接都失效了。
我刚刚尝试了另一个基于 Discourse 的论坛,发现了相同的 403 错误代码。
论坛网站:https://forum.quantifiedself.com/
测试 1:正常
Amazon Deep Learning with Python: Chollet, Francois: 9781617294433: Amazon.com: Books
测试 2:失败,错误代码 500。我猜这个网站尚未升级到最新版本。
Medium https://medium.com/swlh/5-free-python-courses-for-beginners-to-learn-online-e1ca90687caf
测试 3:失败,同样的 403 错误代码,与我的情况完全一致。
Udemy https://www.udemy.com/course/certified-kubernetes-application-developer/
我测试了我所知道的所有基于 Discourse 的网站,结果如下:
| onebox | 站点 1 | 站点 2 | 站点 3 | 站点 4 | 站点 5 | 站点 6 | 站点 7 | 站点 8 |
|---|---|---|---|---|---|---|---|---|
| Amazon | 正常 | 正常 | 正常 | 正常 | 正常 | 正常 | 正常 | 正常 |
| medium | 正常 | 失败 | 正常 | 失败 | 失败 | 正常 | 失败 | 失败 |
| udemy | 失败 | 失败 | 正常 | 正常 | 正常 | 正常 | 失败 | 正常 |
| 位置* | 东京 | 加利福尼亚 | 加利福尼亚 | 加利福尼亚 | 加利福尼亚 | 巴黎 | 加利福尼亚 | 英格兰 |
| 爱尔兰 | 弗吉尼亚 | 芝加哥 | ||||||
| 非洲 | 阿拉斯加 | |||||||
| *使用 Check host 进行测试 |
站点 1. https://vip.studycamp.tw/
站点 2. https://forum.quantifiedself.com/
站点 3. https://discussions.udacity.com/
站点 4. https://forum.uipath.com/
站点 5. https://forums.envato.com/
站点 6. https://rideabl.es/
站点 7. https://blenderartists.org/
站点 8. https://se23.life/
你很幸运,目前只有 amazon.com 能正常工作。
所有其他亚马逊网站,单框预览都无法使用。
您正在测试的网站可能会屏蔽 curl 的用户代理。Oneboxing 过程会根据您尝试 Onebox 的 URL,使用真实浏览器的用户代理。目前,在这种情况下使用的用户代理是:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15
请尝试使用 -A 标志运行您的 curl 测试。例如:
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15" https://www.udemy.com/course/certified-kubernetes-application-developer/ -o deleteme.html --verbose
该命令在您那边的结果是什么?
如果仍然失败:
您是否向这些网站发送了异常大量的 Oneboxing 请求?您可能已被相关网站暂时封禁,等待适当时间后情况可能会恢复正常(这取决于网站运营方,很遗憾我们这边无能为力)。
您的服务器位于何处?您是否有机会在不同位置的另一台机器上运行测试?即使从您的个人电脑而非生产服务器进行测试,也可能得到不同的结果。
谢谢你的建议。
返回代码仍然是 403:
root@localhost:~# curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15" https://www.udemy.com/course/certified-kubernetes-application-developer/ -o deleteme.html --verbose
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 2606:4700::6810:4155:443...
* TCP_NODELAY set
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0* Connected to www.udemy.com (2606:4700::6810:4155) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [3726 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Udemy, Inc.; CN=*.udemy.com
* start date: Sep 10 15:45:40 2020 GMT
* expire date: Oct 12 15:45:40 2021 GMT
* subjectAltName: host "www.udemy.com" matched cert's "*.udemy.com"
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign RSA OV SSL CA 2018
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x5591c76d8e10)
} [5 bytes data]
> GET /course/certified-kubernetes-application-developer/ HTTP/2
> Host: www.udemy.com
> user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15
> accept: */*
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
} [5 bytes data]
< HTTP/2 403
< date: Mon, 17 May 2021 23:59:37 GMT
< content-type: text/plain; charset=UTF-8
< content-length: 16
< x-frame-options: SAMEORIGIN
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< cf-request-id: 0a1e5e6b920000952193363000000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< set-cookie: __cf_bm=3224e014d6b0b4eca1cf8a59c6c180928b2ffa0f-1621295977-1800-AU4UK/k3sl61kbMPYizcsl1TI7NAHkvE1mfjoKIPdrvGAJJeYUF8e72hQljXNwVTO+BcqfsAXxoiQDEy1cL+aVA=; path=/; expires=Tue, 18-May-21 00:29:37 GMT; domain=.udemy.com; HttpOnly; Secure; SameSite=None
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 6510ccf28d0a9521-NRT
<
{ [16 bytes data]
100 16 100 16 0 0 10 0 0:00:01 0:00:01 --:--:-- 10
* Connection #0 to host www.udemy.com left intact
是的,我确实这样做了。但是克隆站点已经超过 20 天没有发布任何新内容,它仍然存在同样的问题。
此外,根据我昨天提到的 测试表,站点 2 和站点 7 也存在相同的问题,我相信这是这些站点上首次出现与 Udemy 相关的帖子。
我的服务器位于日本。我可以在今天晚些时候将克隆站点迁移到其他地区(如美国)进行测试,届时我会再次更新。
更新:
再次感谢。
我这边又做了一些测试。
我能够成功通过 curl 从我的家庭宽带 ISP(北美)以及位于高端数据中心的机器(北美)访问 Udemy 的 URL。
但从某家知名托管提供商(北美)尝试时失败了。从另一家知名托管提供商(欧洲)尝试也同样失败。
当失败时,返回给我的内容体是:
error code: 1020
该错误来自:
Cloudflare 的这篇帖子解释了他们的 1020 错误含义,以及你可以尝试的解决方法:
https://community.cloudflare.com/t/community-tip-fixing-error-1020-access-denied/66439
目前版本为 2.7.0.beta8,如果这有帮助的话。
新构建解决了这个问题,Udemy 的单框预览再次显示。不确定具体是哪个部分修复了它。