Is it possible to search YouTube subtitles? - youtube

Suppose I want to find list of videos which have the phrase "French presidential election" in its subtitle.
Can I do this using YouTube API?
It will be perfect if it can even search within both human-generated and auto-generated subtitles. But it will be good enough if it can search either of the two types of subtitles.

You may refer with this documentation. You can use Captions: list which returns a list of caption tracks that are associated with a specified video.
Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.
You need to provide the videoId parameter that specifies the YouTube video ID of the video for which the API should return caption tracks.
Here's a related thread: How to add Subtitles to Youtube video using Youtube API?

If you want to just search the subtitles from a particular video that is open on youtube.com you can view all the subtitles by selecting 'Open Transcript' from the ... button which is displayed below the main video window and to the right of the title (to the right of SAVE) - then you can just search them using the browser's page search functionality (i.e. Mac: ⌘+F, Win: Ctrl+F)

Related

show youtube playlist titles on web page

Using iframe a youtube playlist embed displays the first video
playlist opens with this view
I want the view to open like this
This is my preferred default view (I would really like to open with titles, not thumbnails
It seems is not possible using YouTube Data API.
You'll have to use YouTube Data API for retrieve the videos from a given playlist, then, use custom code HTML, CSS, javascript, etc, for create a similar result as you need.

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/

Search for youtube videos with captions AND enabled third-party-contributions for captions

My goal is a script to download captions of youtube videos, multilanguage - mostly songs with lyrics or subtitled talks.
I found that captions can be downloaded only if owner of them or are enabled by third-contribution: Downloading captions always returns a 403
How to search for youtube videos filtering out ones that do not have captions in the specified language, and have third-party contribution enabled for captions?
I could not find a reference in the tutorial:
Caption Document
Caption Implementation
Code Samples
Workaround
An alternative approach for me may be to search for videos that only have lyrics in the description using API V3, but I haven't found a guide on how to restrict keyword search to description and not whole snippet.
I tried with part=snippet.description in search list.

YouTube live streaming captions - more than one language

I'm currently live streaming a tv channel (beta phase yet) using YouTube.
How do I add captions in more than 1 language for a live stream (with POST caption URL)?
Even using just one language captions, how can I change the language? (The only option to the user - on web or app - is "EN" even if the caption is in other language)
When using POST approach do send captions on live streams how/where to set/define duration of each subtitle?
Please don't refer this url link. I know it already.
AFAIK you can do only one language, if any at all. I have tried using the POST method YouTube describes on the page you link to - without success. Only get
Result 299: "Error donwloading [...] Can't parse HTTP POST body."
Tried searching all kinds of support forums, but it seems no one has any advice and YouTube never replies to questions related to live caption. Including here...
According to the docs on contentDetails.closedCaptionsType, you can embed captions in your video stream using the option closedCaptionsEmbedded and provide EIA-608 and/or CEA-708 formatted captions in your video from your encoder.
Sending multiple caption tracks muxed with your video with different languages specified by the "Language" tag on the caption stream should allow the user to switch between different captions in the web player.

YouTube API: 'Official Content Only?'

When using the YouTube api to query and retrieve videos, is there a way to limit results only official content? I want to retrieve the new music videos for certain artists but I want to make sure I am only receiving real videos and not UGC stuff. Can this be accomplished? Thank you.
There is no search parameter that ensures that you only get back "real" music videos. (And the line between a "real" video and user-generated content isn't always clear.)

Resources