Giter Club home page Giter Club logo

vt-api's Introduction

VTuber API

A Mongoose / GraphQL based API to serve VTuber information from multiple platforms.

Development

  • Prerequisites:

Installation

# Install dependencies and create your .env copy
$ npm i
$ cp .env.sample .env
# Make sure to adjust your .env file before continuing!

# Create a directory called organizations inside channels, then move the files from
# channels/default to channels/organizations, or check the template.json file to see how to create your own list.

# After populating channels/organizations, run:
$ npm run channel-manager
# OR
$ npm run init

# If all things went well, you can then start the api.
$ npm start

GraphQL Schema

Types

{
  VideoId: string
  ChannelId: string
  PlatformId: "yt"|"bb"|"tt"
  VideoStatus: "live"|"upcoming"|"ended"|"uploaded"|"missing"
}

VideoObject Schema

{
  _id: VideoId!
  platform_id: PlatformId!
  channel_id: ChannelId!
  organization: string!
  title: string!
  time: {
    published: number
    scheduled: number
    start: number
    end: number
    duration: number
  }
  status: VideoStatus!
  viewers: number
}

ChannelObject Schema

{
  _id: number!
  name: {
    en: string!
    jp: string
    kr: string
    cn: string
  }!
  organization: string!
  platform_id: PlatformId!
  channel_name: string
  channel_id: ChannelId!
  details: {
    [key: string]: any
  }
  channel_stats: {
    published_at: number
    views: number
    subscribers: number
    videos: number
  }
  description: string
  thumbnail: string
}

Videos Resource

{
  items: [VideoObject]!
  next_page_token: String
}

Channels Resource

{
  items: [ChannelObject]!
  next_page_token: String
}

Live Query

{
  live(
    organizations: [String]
    platforms: [PlatformId]
    exclude_organizations: [String]
  ): [VideoObject]
}

Videos Query

{
  videos(
    channel_id: [ChannelId]
    status: [VideoStatus]
    organization: [String]
    platforms: [PlatformId]
    max_upcoming_mins: Int
    order_by: {
      published: asc|desc
      scheduled: asc|desc
      start: asc|desc
    }
    next_page_token: String
    limit: Int // 1-50
  ): VideosResource!
}

Channels Query

{
  channels(
    _id: [Int]
    name: String
    organizations: [String]
    platforms: [PlatformId]
    channel_id: [ChannelId]
    order_by: {
      _id: asc|desc
      published_at: asc|desc
      subscribers: asc|desc
    }
    next_page_token: String
    limit: Int // 1-50
  ): ChannelsResource!
}

TO-DOs

  • Implement twitch and bilibili apis
  • Better documentation

vt-api's People

Contributors

altovt avatar chooks22 avatar dependabot[bot] avatar ohareza avatar suuringo avatar winterl avatar yahsieh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vt-api's Issues

Dockerize project

I'm currently working on dockerizing this project and have some problems

  1. Is there any chance that the two init scripts npm run save-channels and npm run init merge to a single script?
  2. The program does not handle exceptions well if GOOGLE_API_KEY not set correctly.
    It gives helper:videoInfo() !!! encountered an error: Cannot read property 'map' of undefined
  3. I think maybe npm run init is missing from README.md?

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.