-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Youtube shortcode fails on 0.125.0+ on an unlisted video (media type not resolved) #12396
Comments
I can confirm this behavior, I am examining the problem closely. ERROR The "youtube" shortcode was unable to get remote resource "https://www.youtube.com/oembed?format=json&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYCaotPnKU5w". error calling resources.GetRemote: failed to resolve media type for remote resource "https://www.youtube.com/oembed?format=json&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYCaotPnKU5w". See "/20220612002812-exploring_my_exo_brain.md:44:1" |
@vonpupp What's the video id in your shortcode call? Please show the markdown. Also:
The YouTube response header has:
So I'm wondering if your system doesn't understand that content type? I have no problem adding any of the videos above with Ubuntu 22.04.4 LTS. EDIT Sat 20 Apr 2024 08:35:04-08:00 I just tested again with a virgin install (plus Git, Go, and VSCode) of Ubuntu 22.04.2 LTS.
No problems, so I am still suspicious of media types (AKA MIME types) on each of your systems. I'm not saying we shouldn't address this, but the underlying cause may determine how we address this. I am disinclined to remove error checking, though maybe we downgrade to a warning. However, if this turns out to be a media type issue on your systems, we may want to look at what |
Thanks you for your answer @jmooring. I am using Arch Linux. The content is an org-mode file converted to md using ox-hugo (an exporter for org-mode). Here is a snippet of the code that I use on the org-mode file.
The video is unlisted. It used to work previously. My version of hugo is:
Here is the rendering of the md file using ox-hugo:
Thank you very much!
|
The above renders for me without error. On your system, do this:
What's the result? |
I will investigate if there are any other pointers surrounding the mystery. |
Going back to the old shortcode helps for now. I think it might be an issue with |
Sure,
I have an older static binary version that works fine:
|
@vonpupp Instead of using an earlier version, for now I suggest you do as the message suggests:
|
Same issue here with v0.125.1 & v0.125.2, but with any YouTube video.. for example:
which is a public video, results this error:
I'm on EndeavourOS. |
This is frustrating. I cannot reproduce the problem with any of the video id's referenced in this issue.
Tested with Ubuntu 22.04 (virgin install plus Git, Go, and VSCode) and Windows 11. @sudoCss As suggested in the error message, add this to your site config until we can figure out what's causing this:
|
@davidsneighbour @sudoCss @vonpupp I would appreciate it if you could post the result of:
|
@sudoCss And what do you see in the browser if you click this: |
and the direct link in the browser shows the JSON response for the oembed. |
I added the config option and the error goes away, naturally. The interesting thing is that the video is shown in the resulting page. So either a fallback comes into play or the error message is somehow false? |
@jmooring looking at
title . I briefly tested removing that remote call and I didn't see any difference in the YouTube videos I saw.
I suggest that we make the life a little easier for ourselves and either:
|
I had hoped to use the oEmbed API for other things in the future (e.g., thumbnail for a simple version), but the server response is obviously inconsistent, perhaps by IP range, proxy, etc. For the same video we get 200/403 or 200/404. I'm inclined to rip the whole thing out. I have the ball. |
- Do not call the YouTube oEmbed API - Do not include the Hugo version in RSS feeds Closes gohugoio#12396
- Do not call the YouTube oEmbed API - Do not include the Hugo version in RSS feeds Closes #12396
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The following shortcode:
leads to this error:
and the server does not start. This has happened since 0.125.0 (0.125.1 also shows the error; it seems unconnected to #12383).
In 0.124.1 it is parsed and shows the video.
hugo v0.124.1-db083b05f16c945fec04f745f0ca8640560cf1ec+extended linux/amd64 BuildDate=2024-03-20T11:40:10Z VendorInfo=gohugoio
hugo v0.125.1-68c5ad638c2072969e47262926b912e80fd71a77+extended linux/amd64 BuildDate=2024-04-18T08:21:19Z VendorInfo=gohugoio
This video is unlisted and other videos on the side do not run into this error.
The text was updated successfully, but these errors were encountered: