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


(Sam) #1

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.


(Jeff Atwood) #2

Weird @techapj can you have a look?


(Stephanie) #3

I just noticed this, too.


(Marcin Rataj) #4

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.

YouTube Engineering and Developers Blog: Dude, are you still on YouTube API v2?

The fix is being prepared upstream:

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


(Jeff Atwood) #5

Any news on this @techapj


(Arpit Jalan) #6

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.


(Arpit Jalan) #7

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.


(Jeff Atwood) #8

Let’s see


(Arpit Jalan) #9

Let’s hope it works this time :pray:

https://www.youtube.com/watch?v=fqVIsp-tQJA


(Jeff Atwood) #10