I tried using the tool `` Youtube Full Text Search '' that can search the subtitle data of the YouTube channel and solve `` Which movie was that remark?

On YouTube, another movie is automatically played after watching, or you click on an interesting movie in the related video column, so you often forget the time and watch a lot of movies. I watched too many, and when I looked back later, I thought, 'I should have found an interesting scene, but I can't remember which one.' A convenient tool for such situations is ' Youtube Full Text Search ', a tool that searches for scenes by text using subtitles.

NotJoeMartinez/yt-fts: Youtube Full Text Search - Search all of a YouTube channel's subtitles from the command line

https://github.com/Not Joe Martinez/yt-fts

Before using Youtube Full Text Search, we will set various preferences. First, download the ' Git Installer '. Once downloaded, double-click the installer to start it and proceed with the installation without changing any settings. If you don't know, please refer to the item 'Installing Git' in another article .

Next, go to

the Python download page and click the yellow button labeled 'Download Python 3.○○.○'.

Check 'Add python.exe to PATH' and click 'Install Now'. Other settings are OK if you proceed with the installation with the default settings.

Since 'Git Bash' is installed at the same time when Git is installed, start it from the start menu.

Then run the following code line by line. We will use Git Bash again later, so leave it running after the execution is finished.
[code]git clone https://github.com/NotJoeMartinez/yt-fts

cd yt-fts

python3 -m venv.env

explorer .[/code]

When explorer starts up, copy the address bar.

Start Command Prompt with administrator privileges.

Execute the following code in order at the command prompt.
[code]cd '[paste copied address]\.env'

mklink /d bin Scripts[/code]

It is OK if the message 'A symbolic link for bin <<==>> Scripts has been created' appears. Command Prompt's turn ends here.

Go back to Git Bash and run the below code in order. All subsequent commands can be entered into Git Bash.
[code]source .env/bin/activate

pip install -r requirements.txt[/code]

Youtube Full Text Search is now ready. Copy the URL of the channel you want to search for subtitles.

Enter the code below to download subtitle data for all movies on that channel.
[code]python yt_fts.py download '[Paste URL]'[/code]

It seems that a total of 8955 movies have been uploaded to the GIGAZINE channel. We were able to download about 3,000 subtitle data per hour, and the process was completed in about 3 hours.

However, an error occurred when saving the downloaded subtitle data to the DB and it stopped.

It says 'UnicodeDecodeError'.

After lightly debugging, it seemed to be solved by passing the encoding information to line 157 of 'yt_fts.py'.

Since data cannot be overwritten, rewrite the DB to an alias and save it. Renamed 'subtitles.db' to 'subtitles.db.bak'.

After downloading the data again over 3 hours, I was able to save all the subtitles in the DB this time.

If you enter 'python yt_fts.py list', the ID, name, and URL of the imported channel will be displayed.

It is possible to search with the command 'python yt_fts.py search [channel ID] '[search word]''. I tried searching with the word 'movie'. The 'title', 'passage containing words', 'time stamp', and 'link that can be played from the position of the subtitle' of the hit movie are displayed.

Since the language setting of the GIGAZINE channel is Japanese, the automatically generated subtitles should be in Japanese, and there are movies that have Japanese subtitles manually, so I tried to see if I could search in Japanese. Unfortunately, it seems that it is not supported at the time of article creation, and the movie did not hit even if I searched for any word.

in Review,   Software,   Video, Posted by log1d_ts