A tool which can capture a Youtube video into images that you can read the video fastly.
./run.py -u <Youtube url> -n <output name> -l <language>
The result files would be placed in the ./results//*
If the result path is already exist, but you want do it again. try again with --retry or -r option.
Only -u option is mandatory.
./run.py -u <Youtube url> -n <output name> -l <language> --retry
For more information, please see the option --help
./run.py -h
./run.py -u 'https://youtu.be/MMmOLN5zBLY' -n multi_lang -l ko
The result would be generate like below. The captured images are in the imsg/.
$ ls ./results/multi_lang/
imgs/ multi_lang.json multi_lang.mp4 multi_lang.srt
Just call these functions.
from capture import capture_by_subs
from run import make_youtube_info
video_info = make_youtube_info(url, name, lang, retry, fontsize)
video_info.save_json()
capture_by_subs(video_info)
- generate video information with dictionary type.
video_info = make_youtube_info(url, name, lang, retry, fontsize)
argument
url : the youtube url
name : result diretory name
lang : language code (en, ko, ru...)
retry : True/False (default False)
fontsize : default 30
- save the information to json file (if you want)
video_info.save_json()
It will save name.json
- capture the video by subtitle time stamps
capture_by_subs(video_info)
the results are generated in directory imgs/
./unit_test.py