Embedded Youtube Videos: URL always showing "https://youtube.com/devicesupport"

As seen here:

There don’t seem to be any unusual steps needed to produce this bug, just posting a youtube video will do it. Affects videos posted before today as well (assuming a recent update is the cause).

Everything else related to the video (actual link to original, video replay) is unaffected.

Update - this appears to only applies to the image generated before the actual video loads. Clicking ‘play’ and loading the video switches out the /devicesupport URL for the title of the Youtube video.

8 Likes

Weird @techapj can you have a look?

I just noticed this, too.

1 Like

The devicesupport message is probably displayed due to deprecation of old API v2 (used by lazyYT while fetching title):

In March 2014, we announced that the v2 API would be retired in April 20, 2015, and would be shut down soon thereafter. To help you with your migration, we launched the migration guide in September. Now, we’d like to provide you with more details on the plan to retire v2.

http://youtube-eng.blogspot.com/2015/03/dude-are-you-still-on-youtube-api-v2.html

The fix is being prepared upstream:

https://github.com/tylerpearson/lazyYT/issues/34

7 Likes

Any news on this @techapj

YouTube Data API (v3) now requires Google Account and registering a new application to retrieve video info via v3 API :disappointed:

Also:

The YouTube Data API uses a quota to ensure that developers use the service as intended and do not create applications that unfairly reduce service quality or limit access for others. All API requests, including invalid requests, incur at least a one-point quota cost.

More info here: YouTube Data API Overview  |  YouTube Data API  |  Google Developers

Looking into it.

EDIT: I may have a fix, working on it.

3 Likes

Fixed via:

https://github.com/discourse/discourse/pull/3437

and

https://github.com/discourse/onebox/pull/298


The solution I came up with is to use YouTube oEmbed endpoint instead of v3 API.

This is the only way to fix this issue without depending on v3 API (that requires Google Account credentials).

Also, note that previously oneboxed YouTube videos will have video link instead of title, like

It’s because until now video title was fetched via API (at runtime), but now video title will be saved as HTML at the time of oneboxing.

2 Likes

Let’s see

1 Like

Let’s hope it works this time :pray:

8 Likes