Hi after so much research i found this link which gives an xml version of the captions with timelines but when i tried to get the same thing using file_get_contents
function in php it just gives only text files.
http://www.youtube.com/api/timedtext?v=7GIDDaF26zE&lang=en
Can any one help me what i am doing wrong?
file_get_contents
reads the entire file into a string. If you wanted to get the video's captions directly, you could use captions.download
, but you either have to be the owner of the video or the owner has to enable third-party contributions for the captions.