Kaustubh251002 / YT-watchlist

Backend project using YT api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YT Watchlist

Fampay Task Submission:

Project Goal

To make an API to fetch latest videos sorted in reverse chronological order of their publishing date-time from YouTube for a given tag/search query in a paginated response.

Basic Requirements:

  • Server should call the YouTube API continuously in background (async) with some interval (say 10 seconds) for fetching the latest videos for a predefined search query and should store the data of vid eos (specifically these fields - Video title, description, publishing datetime, thumbnails URLs and any other fields you require) in a database with proper indexes.
  • A GET API which returns the stored video data in a paginated response sorted in descending order of published datetime.
  • It should be scalable and optimised.

Bonus Points:

  • Add support for supplying multiple API keys so that if quota is exhausted on one, it automatically uses the next available key.
  • Make a dashboard to view the stored videos with filters and sorting options (optional)

This project satisfies all of the above mentioned points

Steps to replicate:

  • Clone this repository:

    git clone https://github.com/Kaustubh251002/YT-watchlist.git
    cd YT-watchlist
    
  • Setup up Virtual env, and install dependencies:

    conda create -n myenv
    conda activate myenv
    pip install -r requirements.txt
    
  • Add your API keys and MONGO uri to the .env file

  • Run the flask server

    python app.py
    

The server should now be running on http://localhost:5000, and API endpoint at http://localhost:5000/videos

The data dashboard can be accesed through here

About

Backend project using YT api


Languages

Language:Python 100.0%