How to search for a text in YouTube subtitles

How to search for a text in YouTube subtitles

A simple device that allows you to search for text in YouTube videos. In this way, you can immediately find what interests you without being forced to see the entire content.

It often happens that you don’t have the material time to watch a long presentation posted on YouTube. One of the most interesting and useful features of the Google service is the so-calledautomatic subtitles.

Subtitles are a great way to make content more accessible: YouTube is capable of using Google’s speech recognition technology to automatically generate subtitles for videos, including those uploaded by users.

TheYouTube closed captioningis produced using algorithmsmachine learningmore and more effective thanks to continuous improvements. Thespeech-to-texttransformation, however, can lead to variable results depending on the language used, any inflections, any imperfect pronunciation of foreign terms, the topic covered in the video. Before discovering how to search for text in YouTube subtitles and export them to a text file, we suggest checking that the Subtitles button is actually present in the lower right corner of the YouTube video.

Screenshot 26 1

By clicking on this button it is possible to activate subtitles and to overlay everything that is said in the video.

With a click on theSettingsbutton (it looks like a small gear), you cancheck if the YouTube subtitles have been generated automaticallyor uploaded by the author of the content.

An extremely useful possibility is that it allows you toobtain the translation of speech in real-time: if a video was made in another language, by clicking on theSettingsicon you can choose Italian and read the subtitles thanks to automatic translation.

How to extract YouTube video subtitles and search in text

Tosearch for a text in the subtitles of YouTube videos,you can follow a procedure that does not require the use of any tool made by third parties:

1) Install and launch Google Chrome.

2) Open the YouTube video of interest.

3) Right-click in a free area of ​​the page and chooseInspect.

4) From the menu at the top right, choose theNetworkitem.

main qimg 3862064f9b2cf1becc95592cd3e2a33f 1

5) Click once or twice on theSubtitlesbutton: in theNetworktab, you will see an indication referring to an element called timed text.

cercare testi sottotitoli youtube 03 1 1

6) Right-click on < timedtext and selectOpen in new tab.

7) You will get a file in JSON format containing the entire transcription of the text spoken in the YouTube video. By pressing the key combination CTRL + F you can start a search.

The fact is that the JSON file contains references to the texts used in the video in the utf8 objects and each occurrence usually contains only one word.

8) To remove all superfluous elements by extracting only the contents of utf8 objects, we suggest you “arm yourself” with the Notepad ++ text editor.

In the open tab in Chrome, you have to press the key combination Ctrl + A to select all the contents of the JSON file containing the transcription of the YouTube text then paste it intoNotepad ++by pressing CTRL + V.

9) By choosingSearch, Replace(Find, Replace,in Italia) from Notepad ++ (alternative menu you can press CTRL + H ), you will have to tick the boxRegular expression(Regular Expression) and paste. +? Utf8 “:” (. +?). “+? \} in the fieldFind what(Find).

add p tag to beginning line 1 2

Pressing the buttonReplace all(Replace all),Notepad ++automatically extracts only the content of objects utf8.

10) To remove the occurrences of \ n added in the transcription of YouTube, just then type \ n in the fieldFind what(Find) and press the spacebar once in the field belowthe Replace with(Replace with).

npreplace 1

However, as theSearch Type, you willneed to specifyNormalinstead ofRegular Expression. Finally, click on Replace all.

Alternatively, can obtain the subtitles of any YouTube video simply by pasting the URL in the appropriate field and choosingSelect action.

If you want to stay up to date,follow us onInstagram,Twitter.If you want to receive support for any questions or problems, join ourFacebookGroup or contact us onInstagram,Gmail,Linkedin, etc

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top