Failed to load closed captions in Youtube API v3

I'm using the PHP example code given in Youtube API v3: https://developers.google.com/youtube/v3/docs/captions/download to load captions from third party public YouTube videos my webapp i.e. I have NOT uploaded content to Youtube.

I can access the subtitle track list but cannot load the title using the title track id from the resulting list.

Error while trying to LOAD:

Error when calling GET https: // www.googleapis.com/youtube/v3/captions/Lw0e5xDNU17GFafOl8DcyeOtwzWJTf9V?tfmt=srt&alt=media: (404) Not found

(I tried to remove the tfmt (optional parameter) but it still gives an error.)

But for trying to remove titles, the error is different:

DELETE call failed https: // www.googleapis.com/youtube/v3/captions?id=Lw0e5xDNU17GFafOl8DcyeOtwzWJTf9V: (403) Forbidden

So it seems that captions.download is NOT forbidden for non-owner users (just like captions.list is NOT forbidden) and so I would like to use this data for my webapp.

Any help is gratefully received.

Thank,

Nikhil

+3


source to share


2 answers


I found another way to access any YouTube video title data. The code is written in Ruby.

Read Youtube transcript (credits) from any public Youtube video



Works great, I just need to find a way to integrate this with my webapp.

+1


source


I just tried the url you mentioned in the browser and in the browser API and in both cases I got 401 when I didn't have an oAuth token and 403 when I had an access token (since I am not the owner), so the final points act as intended; According to the documentation , uploading signatures requires oAuth consent from the video owner.



Perhaps if you are getting 404s instead, is there a problem in the PHP library?

+1


source







All Articles