Skip to content

tinytengu/yt_subtitles_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yt_subtitles_parser

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.

Version 0.1 Python 3.10 Poetry 1.2.0

Installation:

Poetry:

poetry install

Pip:

pip3 install -r requirements.txt

Usage:

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

License

GNU GPL v3