og:image not being updated when browsing different youtube videos - youtube

I seen something strange when browsing youtube videos. The og:image does not change as I keep browsing from one page to another. The og:image always points to the first youtube video. Of course, if I manually refresh the page, I see the correct og:image information.

YOUTUBE use nodejs for their site. Nodejs is a javascript enable server site script, as nodejs is a non blocking code, that means it first updates that part of webpage which takes less time to execute and vice versa.og:image contains, default video thumbnail. You can use url of thumbnail to get og:image.
For the high quality version of the thumbnail use a url similar to this:
https://ytimg.googleusercontent.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg
For videos which have high quality you can use below url. For HQ videos.
For the maximum resolution version of the thumbnail use a url similar to this:
https://ytimg.googleusercontent.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg

Related

For YouTube video, how to automatically display interactive transcript?

YouTube supports interactive-transcripts, using both machine-generated and user-uploaded transcripts. This is very useful for hearings, lectures, speeches, and educational videos where a visitor might want to read along or jump around. For example in this video:
https://www.youtube.com/watch?v=IY3U2GXhz44
The visitor can click on "...More" and then "Transcript" to view the interactive-transcript.
How does a video owner make that hidden feature automatically open for visitors? I cannot find any documented method for doing that through the API for either embed or linked videos. Is there an undocumented method in the API, or a URL parameter like "&action-panel-transcript=true" that works the way I'd expect it to?
As for url parameter, you can try adding &cc_load_policy=1 behind the rel=0 if it's an embedded video or &yt:cc=on at the end of the url if it's a link to the video.
Source: https://www.makeuseof.com/tag/force-subtitles-embedded-youtube-video/

How can you get high definition thumbnails for small iframes with YouTube iframe API?

Using the YouTube iframe API to embed YouTube videos into our website, if the iframe is too small (anything smaller than 270px by 156px or so) the iframe does not use a high definition thumbnail. It works fine for any larger iframes.
The thumbnail is available, but when the YouTube API requests it, it simply requests /i1.ytimg.com/vi/<Video Id>/default.jpg instead of //i1.ytimg.com/vi/<Video Id>/hqdefault.jpg.
Is there anyway to force the thumbnail to be the high definition one?
Here is a link to a website with three embedded YouTube videos all generated using the same code but different dimensions. The two on the left do not request a high quality thumbnail, the one on the right does.
http://pub-dev.lucidpress.com/ef93fe08-3740-4c22-b47a-04483d8ed35b/

How to get video download link from youtube?

I searched far and wide and came up with nothing.
Ok, that is not completely true, there are in fact tons of solutions on the Internet (even here on stackoverflow) on how to get a download link for youtube video, but not a single one of them is working anymore, since youtube seems keep changing things all the time.
What I want to do, is to write a PHP script which will be able to download video from specified youtube page and then save it on the server in flv or mp4 format.
I can get some video information by downloading this: http://www.youtube.com/get_video_info?&video_id=VIDEO_ID
But thats about it, no matter what I do, I just cannot figure out how find the link pointing to the video download.
I tried to use this link: http://youtube.com/get_video?video_id=VIDEO_ID&t=TOKEN&fmt=18&asv=2 from one more recent solution I found, but either there is something missing in it, or it's completely outdated already too.
So how can I dig out some working link for direct video download from youtube?
There has to be some way to do it, since there are some web pages out there which provide this service.
Thank you for any advices.
I prefer RealPlayer to download videos from youtube and other video sharing sites like metacafe, funnyordie and others. You're able to download in both mp4 or flv format, save them, and view them whenever you'd like.. even if you're not online which is great for travel. http://www.real.com/realdownloader

Patterns between YouTube m. and normal site urls

My site is not able to show uploaded youtube videos when the url is a mobile (m.) site, but it works for the normal youtube site. It seems to me that the mobile and normal urls differ in a pattern, as shown below:
http://www.youtube.com/watch?v=5ILbPFSc4_4
http://m.youtube.com/#/watch?v=5ILbPFSc4_4&desktop_uri=%2Fwatch%3Fv%3D5ILbPFSc4_4
obviously, the m. is added, as is the /#, and all the &desktop_uri... stuff.
and again:
http://www.youtube.com/watch?v=8To-6VIJZRE
http://m.youtube.com/#/watch?v=9To-6VIJZRE&desktop_uri=%2Fwatch%3Fv%3D8To-6VIJZRE
What we hope to do is check to see if the url is mobile site, and if it is, parse it so it shows as the normal site.
Does any one know if all youtube urls work this way--if this similar pattern works for all the same videos on mobile and normal sites?
In general, any time you attempt to parse URLs for sites (as opposed to web APIs) by hand, you're leaving yourself open to breakage. There's no "contract" in place that states that a common format will always be used for watch page URLs on the mobile site, or on the desktop site.
The oEmbed service is what you should use whenever you want to take a YouTube watch page URL as input and get information about the underlying video resource as output in a programmatic fashion. That being said, the oEmbed response doesn't include a canonical link to the desktop YouTube watch page, so it's not going to give you exactly what you want in this case. For many use cases, such as when you want to get the embed code for a video given its watch page URL, it's the right choice.
If you do code something by hand, please ensure that your code is deployed somewhere where it would be easy to update if the format of the watch pages ever do change.

Youtube player for multiple videos from various accounts

I have a page that has many videos on it and the page has become so slow it is unusable. These are all Youtube videos and I changed to the new iFrame tags hoping that would help the loading. I need a solution to make this page more useable.
I would be happy if I could just pull a frame from the video and display that, when clicked it would load the video. Or I would be happy with a multi-video player. The custom play from Youtube will not work because the videos I am serving are not all from my account and as I understand the custom player you reference a group from your account. I have also considered using AJAX to load the iframe, which would be okay too if I could figure out how to get a thumbnail of the video to show as a link.
Ideas and suggestions are welcome. Thanks in advance for any ideas.
YouTube API is made up of 2 different sets - one for the player and one for the data.
You can start here ...
http://code.google.com/apis/youtube/overview.html
... then click on "Data API" link and after looking over that page, click on the "Reference Guide" link.
In essence, the gData API will allow you to get videos in numerous ways (feeds, channels, tops, etc) in chunks of up to 100 videos at a time, using a startIndex (or whatever it may be called) option for paging. What you get is an XML document with parts or everything that YT has about a video, including not one but several different thumbnail images.
HTH helps you and/or another Web 0.2 Fellow (like me)

Resources