Skip to content

Latest commit

 

History

History
55 lines (49 loc) · 2.99 KB

README.md

File metadata and controls

55 lines (49 loc) · 2.99 KB

YTBSP-Server

version dependencies Known Vulnerabilities license

Caching server for YouTube API requests made for usage with the YTBSP-userscript.

REST-API

Installation:

  • Install node (with NPM >= 10)
  • Install mongoDB on the host computer or set up a remote mongoDB
  • Run npm install in the project directory.
  • configure your settings:
    • Copy the settings.example.json and rename it to settings.json
    • Open settings.json and replace the dummy values with your actual credentials.
      For "web" use the credentials downloaded (see API client section).
      Leave "db" empty if using mongoDB on localhost else fill the three fields.
    • If you want to locate the settings.json not in the project root directory you can change the path using the "settings_path" environment variable or the "settings_path=..." command line argument.
    • The settings file can also be fetched using the "settings_url" environment variable or the "settings_url=..." command line argument.
  • Run npm run start in the project directory.
  • Enjoy your server!

API client

This server depends on a Google API project and the Youtube v3 API. To start a project and enable the API please read the reference:
https://developers.google.com/youtube/v3/getting-started

After your project is set up you can download the credentials JSON file from:
https://console.cloud.google.com/apis/credentials credentials

Hosting

Works great with heroku (free*).
The settings and credentials can be set via heroku environment variables.
We recommend to host the DB on an external server like MongoDB Cloud (free*).
* Services have free and paid plans.