How to Download Videos from YouTube and Embed Subtitles in Batch
All I want to do is download some courses that are very helpful for me on YouTube, embed Zh-Hans subtitles in the videos, and then submit them to Chinese websites that do not support external subtitles.
This can help Chinese students who are not fluent in English and cannot access YouTube.
Youtube-dl config
The file path is ~/.config/youtube-dl/config
1 | --o '%(playlist_index)02ds - %(title)s.%(ext)s' |
Download in Batch
1 | playlist='https://www.youtube.com/playlist?list=...' |
Batch Translate File Names
After downloading all the videos in the list, use
ls | grep mkv | sed "s/\.mkv//"
Then copy and paste it to Google to get the translated text, and save it to zh.txt
Embed Subtitles in Batch
1 | tmp="tmp.mkv" |
On an Intel Core i7, it usually took me a whole night to record 20 videos, and it took 20 minutes to embed subtitles in an hour-long video.
Translated by gpt-3.5-turbo