Skip to content
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 for private videos causes error and failure to build site #12383

Closed
max-allan-cgr opened this issue Apr 17, 2024 · 4 comments · Fixed by #12385
Closed

YouTube shortcode for private videos causes error and failure to build site #12383

max-allan-cgr opened this issue Apr 17, 2024 · 4 comments · Fixed by #12385

Comments

@max-allan-cgr
Copy link

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%3DMxxxxxx18". failed to fetch remote resource: Forbidden. See "/workspaces/wiki/content/docs/document.md:48:1"

I've xxx'ed the actual URL because it is a private video. So Hugo will not be allowed to view it while building the site. Which is probably why it gets a 403.

In previous versions, I'm assuming you were ignoring the error and the site builds and views perfectly OK. I can view the video, because I am logged in with my Google account.

I suspect this is going to cause a lot of people (with private videos) some pain.

NB this issue is similar to but NOT a duplicate of #12380 . Not a duplicate because they show a screenshot of a video failing to load in 0.124. On our site, videos load perfectly well with 0.124

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.125.0+extended linux/arm64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes, this IS the latest release!

@bep bep added this to the v0.125.1 milestone Apr 17, 2024
@bep bep removed the NeedsTriage label Apr 17, 2024
@bep
Copy link
Member

bep commented Apr 17, 2024

I suspect this is going to cause a lot of people (with private videos) some pain.

Having a published site with private videos doesn't sound like a common use case.

@xnox
Copy link

xnox commented Apr 17, 2024

I suspect this is going to cause a lot of people (with private videos) some pain.

Having a published site with private videos doesn't sound like a common use case.

It's an internal authenticated wiki site.

bep added a commit to bep/hugo that referenced this issue Apr 17, 2024
bep added a commit to bep/hugo that referenced this issue Apr 17, 2024
@tech-andgar
Copy link

tech-andgar commented Apr 17, 2024

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%3DMxxxxxx18". failed to fetch remote resource: Forbidden. See "/workspaces/wiki/content/docs/document.md:48:1"

I've xxx'ed the actual URL because it is a private video. So Hugo will not be allowed to view it while building the site. Which is probably why it gets a 403.

In previous versions, I'm assuming you were ignoring the error and the site builds and views perfectly OK. I can view the video, because I am logged in with my Google account.

I suspect this is going to cause a lot of people (with private videos) some pain.

NB this issue is similar to but NOT a duplicate of #12380 . Not a duplicate because they show a screenshot of a video failing to load in 0.124. On our site, videos load perfectly well with 0.124

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.125.0+extended linux/arm64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes, this IS the latest release!

Same error

reproduce step:

{{< youtube nEXXXXXXcyQ >}}

// YT link private, but work in Hugo version 0.124.1
image

$  hugo serve
Watching for changes in /Documents/homepage/{assets,content,data,i18n,layouts,package.json,static,themes}
Watching for config changes in /Documents/homepage/config.toml, /Documents//homepage/themes/hugo-coder/config.toml
Start building sites … 
hugo v0.125.0-a32400b5f4e704daf7de19f44584baf77a4501ab+extended darwin/arm64 BuildDate=2024-04-16T15:04:41Z VendorInfo=brew

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%3AnEXXXXXXcyQ". failed to fetch remote resource: Unauthorized. See "/Documents/homepage/content/posts/{{url-post}}.es.md:49:1"
Built in 310 ms
Error: error building site: logged 1 error(s)

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants