Giter VIP home page Giter VIP logo

holoscrape's Introduction

Automated Extensible YouTube Livestream Chat Scraper and Visualiser.

Tests Project Status: Active โ€“ The project has reached a stable, usable state and is being actively developed. Python 3.9

Main Features

  • Automatically detect existing livestreams. Polling will be done periodically to the specified indexers. The indexers are in charge of generating live YouTube video-ids to be scraped.
  • Dispatch to tmux panes in real time. Display current streams in an interactive pane which will grow or shrink in size as live streams come and go.
  • Customisable processors. Write to a database, write to files, or create your own processor.
  • Customisable indexers. Don't follow Hololive? Write your own indexers instead to produce video-ids of your favourite streamers.

How To

Installing Requirements

sudo apt install tmux
pip3 install -r requirements.txt

Configuring

The in-built Holodex indexers require API keys to be supplied, and they are given by the env var HOLODEX_API_KEY.

Config reading defaults to config.json.

If write_to_db or write_to_local is false, their respective subconfigs can be omitted.

{
    "write_to_db": true, <-- Mandatory
    "db_host": <host>,
    "db_port": <port>,
    "db_user": "username",
    "db_password": "password",
    "db_database": "password",
    "db_table": "example_tab",
    "db_stream_table": "stream_tab",
    "db_nshards": 30,

    "write_to_local": true, <-- Mandatory
    "local_path": "/path/to/data/",

    "log_path": "/path/to/logs/", <-- Mandatory
}

An example database schema is given in init.sql that works with the example configs above. If you don't know your way around it, just turn write_to_db off.

Running (in tmux)

python3 main.py
'ctrl-b s' to change to the scraping window

holoscrape's People

Contributors

dannylty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

greatbotmaker

holoscrape's Issues

Refactor main.py config hardcoding

Find a way not to hardcode the indexers and writers?

    stream_indexers = (HolodexIndexer(), NijisanjiIndexer())
    writers = []
    if config_handler.write_to_db:
        writers.append(DatabaseWriter(config_handler, None))
    if config_handler.write_to_local:
        for folder in ['simple', 'metadata']:
            os.mkdir(os.path.join(config_handler.local_path, folder))
        writers.append(FilesystemWriter(config_handler, None))

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.