Skip to content

Latest commit

 

History

History
107 lines (88 loc) · 3.19 KB

README.md

File metadata and controls

107 lines (88 loc) · 3.19 KB

Flash Facts

Flash Facts is a mini-news website that uses AI to condense news/facts from YT videos.

Flash Facts provides quick and concise news summaries by leveraging artificial intelligence. It gathers news from various sources on YT and delivers them in a condensed format, making it easy to stay updated with minimal effort.

Features

  • AI-Powered Summarization: Uses AI models (like ChatGPT and Gemini) to summarize news articles.
  • Diverse News Sources: Aggregates news from multiple YT channels and/or playlists.
  • User-Friendly Interface: Simple and modern web GUI.

Prerequisites

Before the first run, you’ll need the following API keys:

  1. Gemini API key: required for generating news summaries.
  2. YouTube Data API V3 key: required for fetching videos from YouTube.
  3. [Optional] Unsplash API key: needed, if you want, to get automatically images from Unsplash.

Installation & Setup

To get started, follow these steps

# clone the repo
git clone https://github.com/yourusername/FlashFacts.git
cd FlashFacts

# create a virtual environment
python -m venv venv
source venv/bin/activate # linux and macos
.\venv\Scripts\activate # windows

# install the requirements
pip install -r requirements.txt

Use the --setup argument and fill up the information needed

python app.py --setup

Usage

There are two ways to run the script to fetch and generate news:

  1. Provide a CSV of sources
python app.py -s examples/sources.csv
# example of sources
category    language    type        channel     id
news        en          channel     BBC         @BBCNews
news        it          playlist    Euronews    PLGWKgaTMGTQs65mOM0B_UgwDUzL2BXGcd
...

Optional parameters:

  • -d: Specify the number of days to go back for videos.
# get last 7 days videos of the sources provided
python app.py -s examples/sources.csv -d 7
  1. Provide a folder containing transcripts in text format
python app.py -t examples/transcripts

General optional parameters

  • -l: Specify the output language.
python app.py -s examples/sources.csv -l italian
  • -o: Specify the output file path.
python app.py -s examples/sources.csv -o output_folder/result
  • -f: Specify the output format.
python app.py -s examples/sources.csv -f json
  • --save-on-mongo: Save the output in a MongoDB collection.
python app.py -s examples/sources.csv --save-on-mongo

To use this last feature you need to setup the MongoDB connection.

python app.py --setup mongo

Web GUI

In order too Run the web interface, you only need to run the script with --gui.
WARNING: Web GUI, for now, onyl works with data on MongoDB

python app.py --gui

and go to http://localhost:8200. You can change host and port with the setup

python app.py --setup gui

Check out a working example: news.moris.dev

Future Additions

  • OpenAI support (ChatGPT API)
  • Web GUI news from local folders