Giter Site home page Giter Site logo

yt-fts's Introduction

yt-fts

yt-fts is a simple python script that uses yt-dlp to scrape all of a youtube channels subtitles and load them into an sqlite database that is searchable from the command line. It allows you to query a channel for specific key word or phrase and will generate time stamped youtube urls to the video containing the keyword.

Installation

git clone https://github.com/NotJoeMartinez/yt-fts
cd yt-fts
python3 -m venv .env
source .env/bin/activate
pip install -r requirements.txt

This project requires yt-dlp installed globally. Platform specific installation instructions are available on the yt-dlp wiki.

pip

python3 -m pip install -U yt-dlp

MacOS/Homebrew

brew install yt-dlp

Windows/winget

winget install yt-dlp

Usage

Usage: yt_fts.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  delete    delete [channel id]
  download  download [channel url]
  export    export [channel id] [search text]
  list      Lists channels
  search    search [channel id] [search text]

download

Will download all of a channels vtt files into your database

python yt_fts.py download "https://www.youtube.com/@TimDillonShow/videos"

If this fails you can manually input the channel id with the --channel-id flag

python yt_fts.py download "https://www.youtube.com/@TimDillonShow/videos" --channel-id "UC4woSp8ITBoYDmjkukhEhxg"

You can specify expected subtitles language

python yt_fts.py download "https://www.youtube.com/@TimDillonShow/videos" --language de

list

Will list all of your downloaded channels

python yt_fts.py list

output:

Listing channels
channel_id                channel_name         channel_url
------------------------  -------------------  ---------------------------------------------------------------
UC4woSp8ITBoYDmjkukhEhxg  The Tim Dillon Show  https://www.youtube.com/channel/UC4woSp8ITBoYDmjkukhEhxg/videos

search

Will search a channel for text based off the channel id you give it and will print a url to that point in the video

python yt_fts.py search [channel_id] "text you want to find"

EX:

python yt_fts.py search UC4woSp8ITBoYDmjkukhEhxg "life in the big city"

output:

Video title"("#208 - Let's Have A Party | The Tim Dillon Show - YouTube",)"

    Quote: "life in the big city Dan is wearing the"
    Time Stamp: 01:50:07.790
    Link: https://youtu.be/CJ_KAsz8rjQ?t=6604

Video title"('#176 - The Florida Project | The Tim Dillon Show - YouTube',)"

    Quote: "the show life in the big city love these"
    Time Stamp: 00:31:05.669
    Link: https://youtu.be/nKcqbHQndFQ?t=1862

Video title"('164 - Life In The Big City - YouTube',)"

    Quote: "life in the big city it was one of my"
    Time Stamp: 00:27:17.549
    Link: https://youtu.be/dqGyCTbzYmc?t=1634

Export

Similar to search except it will export all of the search results to a csv with the format: Video Title,Quote,Time Stamp,Link as it's headers

Delete

Will delete a channel from your database

python yt_fts.py delete [channel_id]

yt-fts's People

Contributors

notjoemartinez avatar teddybear06 avatar tonym128 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.