Parse YouTube videos by subtitles using Python 3.
Script uses filmot.com service under the hood because the last thing I want is to gather subtitles from all videos on YT.
I only use the latest versions of Python to have access to the latest and coolest features, so Poetry requires one to use Python ^3.10, although I'm pretty sure this script may work on earlier versions, figure it out by yourself.
poetry install
pip3 install -r requirements.txt
python3 parser.py --help
usage: parser.py [-h] -q QUERY [-o OUT] [-s SEPARATOR] [-p PAGES] [-l {NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}]
[-f FORMAT]
Parse YouTube videos by subtitles using Python 3
options:
-h, --help show this help message and exit
-q QUERY, --query QUERY
Search query
-o OUT, --out OUT File to write results out
-s SEPARATOR, --separator SEPARATOR
Output items separator. Defaults to: ,
-p PAGES, --pages PAGES
Number of pages to process. Defaults to: 1
-l {NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log {NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}
Logging level. Defaults to: INFO
-f FORMAT, --format FORMAT
Output data format. Defaults to: %(yt_url)s%(video_id)s