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
Improve error message for YouTube videos that disabled embedding #16048
Comments
Hey there, thank you so much for the detailed bug report. That does look like something that shouldn't happen! A PR to fix this issue would be very welcome 🙂 |
Thanks @ErisDS ! I'm not sure I have a lot of spare time in the next weeks, so if anybody else reading this wants to swoop in, feel free! Otherwise, I'll keep it in mind and might get back to it eventually 😇 |
This issue seems to duplicate issue 10624. I traced the problem back to oembed-extractor, which Ghost uses to extract the oembed payload from the provider (in this case Youtube). The Opened issue 168 with oembed-extractor to see if the author can add in some error handling for this case — issue 39 (same issue) was previously closed because the author couldn't replicate the issue, but I've been able to reliably replicate it with the Youtube URL linked above so hopefully should be able to get it resolved this time. |
…disabled fixes TryGhost#16048 - When attempting to embed a Youtube video that has had embedding disabled by its owner/author, Ghost displayed a generic error message that didn't indicate the reason for the failed embed. - This change updated the error message when Youtube (or any provider) returns 401: Unauthorized to indicate that the owner of the resource has explicity disabled embedding.
…disabled fixes TryGhost#16048 - When attempting to embed a Youtube video that has had embedding disabled by its owner/author, Ghost displayed a generic error message that didn't indicate the reason for the failed embed. - This change updated the error message when Youtube (or any provider) returns 401: Unauthorized to indicate that the owner of the resource has explicity disabled embedding.
Status update: PR is ready and approved to merge, but we want to be careful with deployment/rollout. Last time we updated the |
refs TryGhost#16048 - When attempting to embed a Youtube video that has had embedding disabled by its owner/author, Ghost displayed a generic error message that didn't indicate the reason for the failed emebed. - This change updated the error message when Youtube (or any provider) returns 401: Unauthorized to indicate that the owner of the resource has explicitly disabled embedding.
refs TryGhost#16048 - When attempting to embed a Youtube video that has had embedding disabled by its owner/author, Ghost displayed a generic error message that didn't indicate the reason for the failed emebed. - This change updated the error message when Youtube (or any provider) returns 401: Unauthorized to indicate that the owner of the resource has explicitly disabled embedding.
refs TryGhost#16048 - When attempting to embed a Youtube video that has had embedding disabled by its owner/author, Ghost displayed a generic error message that didn't indicate the reason for the failed emebed. - This change updated the error message when Youtube (or any provider) returns 401: Unauthorized to indicate that the owner of the resource has explicitly disabled embedding.
refs #16048 - When attempting to embed a Youtube video that has had embedding disabled by its owner/author, Ghost displayed a generic error message that didn't indicate the reason for the failed emebed. - This change updated the error message when Youtube (or any provider) returns 401: Unauthorized to indicate that the owner of the resource has explicitly disabled embedding.
Fixed with this commit: 27e4523 |
Issue Summary
EDIT: I've figured out that this specific YouTube doesn't allow embedding. Maybe you could improve the error message shown to the user if you get the
Unauthorized
message (see below) so this causes less confusion. I have also updated the issue title to reflect this. I'm leaving the following text here as was to leave the context.In general, YouTube embedding works. But this specific returns an error:
https://www.youtube.com/watch?v=5f-JlzBuUUU
.The request is the following:
The error response is the following:
This is becaue the request
https://www.youtube.com/oembed?format=json&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5f-JlzBuUUU
Returns
Unauthorized
as the response body.Steps to Reproduce
https://www.youtube.com/watch?v=5f-JlzBuUUU
Ghost Version
5.26.3
Node.js Version
16.18.1
How did you install Ghost?
Hetzner, Ubuntu 22.04.1
Database type
MySQL 8
Browser & OS version
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: