Youtube embeddings have stopped working for servers in Europe

Just to add, the same problem occurs for /user/ account links too:

6 Likes

Is it possible for you to test those URLs again? This is what I’m currently seeing from a server in Frankfurt (wget output edited to just show the redirects):

wget 'https://youtu.be/KCyIfcevExE'

--2021-04-06 19:03:39--  https://youtu.be/KCyIfcevExE
Location: https://www.youtube.com/watch?v=KCyIfcevExE&feature=youtu.be [following]

--2021-04-06 19:03:39--  https://www.youtube.com/watch?v=KCyIfcevExE&feature=youtu.be
Location: https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKCyIfcevExE%26feature%3Dyoutu.be&gl=DE&m=0&pc=yt&uxe=23983172&hl=de&src=1 [following]

or

wget 'https://youtube.com/watch?v=KCyIfcevExE'

--2021-04-06 19:05:45--  https://youtube.com/watch?v=KCyIfcevExE
Location: https://consent.youtube.com/m?continue=https%3A%2F%2Fyoutube.com%2Fwatch%3Fv%3DKCyIfcevExE&gl=DE&m=0&pc=yt&uxe=23983172&hl=de&src=1 [following]

--2021-04-06 19:05:45--  https://consent.youtube.com/m?continue=https%3A%2F%2Fyoutube.com%2Fwatch%3Fv%3DKCyIfcevExE&gl=DE&m=0&pc=yt&uxe=23983172&hl=de&src=1
Location: https://consent.youtube.com/ml?continue=https://youtube.com/watch?v%3DKCyIfcevExE&gl=DE&hl=de&pc=yt&uxe=23983172&src=1 [following]

(i.e., those two URL formats are now also redirecting to the consent page)

3 Likes

I just tried that URL for you, on my UK-based server, and it onebox/previewed fine:

And if I change it to the full / long URL, I get the consent issue again:

3 Likes

And a wget from the server, if it helps?

Screen Shot 2021-04-06 at 20.41.50

1 Like

Strange, no?

That the wget takes you to the consent page, but the onebox’ing doesn’t? :thinking:


EDIT/UPDATE:

I’m not a python developer, but does this help?

2 Likes

I noticed that the ‘embed’ URLs for YouTube videos don’t (currently!) redirect to the consent page. I’ve created a couple of PRs so that we’ll attempt to fetch embed URLs and parse the JSON contained within the response body.

It’s not the most elegant solution, but it might be a reasonable way forward for now.

13 Likes

That’s great news, appreciate you taking the time to look in to this for us all :+1:t2:

2 Likes

A possible fix for this has been merged in. Can those affected please update if possible, and let us know if the problem with Oneboxing videos has been resolved?

11 Likes

This is 100% a YouTube issue, not a Discourse issue.

@techAPJ went over and above to solve a similar issue with Instagram oneboxes last year, again when it was an Instagram issue and not a Discourse issue.

@jamie.wilson and anyone else who worked on this YouTube issue over the last week or so, I can’t thank you enough.

The level of support you all provide when it’s not even your problem is simply second to none.

I thank you all for your time and dedication :bowing_man:t2:

6 Likes

I can update our Discourse tomorrow morning. Will report back.

2 Likes

It’s looking good on my staging server - I’ll upgrade the production site this morning and will update my report.

Edit: our YouTube embeds are working properly again :ok_hand: Thanks for your help @jamie.wilson!

6 Likes

Also confirmed!

I can even click “Rebuild HTML” on previously failed ones and the video appears in under a second :clap:t2:

Great job @jamie.wilson - Thank you :bowing_man:

4 Likes

Have you tried embedding via the youtube-nocookie.com domain?

Embed videos and playlists - YouTube Help → “Turn on privacy enhanced mode”

3 Likes

Can also confirm this works, server is in Germany. Thanks a lot! :heart:

1 Like

Any chance this could be merged into the stable branch as well to be included in its next release?

When a stable release is cut (next one happens next month) all commits will be included!

3 Likes

Sorry, perhaps I’m not using the right terms here. I didn’t mean version 2.7, but what is likely to become 2.6.5.

Our policy is to only backport critical security fixes to old stable releases, so I’m afraid you will have to move to our standard release channel or wait for next stable.

Unless @jamie.wilson says it’s a clean backport, but at this point in the release cycle it may be too risky.

2 Likes

Fair enough — that’s a reasonable policy and I respect that.

Just though asking anyway as this is a quite annoying thing to live with for some weeks for those who opted for this channel for the stability.

1 Like

That’s the thing right? The stable channel is not our default release channel, and not what we ship to our many paying customers for a reason.

Because while it provides a “stable” source code for the product, the internet it interacts with is much more dynamic, and we go for great lengths to quickly adapt Discourse to the changing environment in the internet, be it changing behaviors on the browsers who are updated every other week, in the thousands of sites we onebox, etc.

7 Likes