ihateani-me / vtscheduler-ts

A VTuber live scheduler, Backend for ihaapi-ts | Mirror: https://git.ihateani.me/ihateani-me/vtscheduler-ts
https://api.ihateani.me
MIT License
8 stars 0 forks source link

Twitch Stream Schedules via Twitch GraphQL API #2

Closed noaione closed 3 years ago

noaione commented 3 years ago

Try to implement a schedule for Twitch by utilizing the GQL API that used internally.

This implementation will be removed whenever Twitch decided to release it to their Helix API and will be replaced by that.

Schemas

query StreamSchedule($login:String,$startDate:Time) {
    user(login:$login) {
        channel {
            schedule {
                id
                segments(startingWeekday:"MONDAY",relativeDate:$startDate) {
                    id
                    isCancelled
                    cancelledUntil
                    startAt
                    endAt
                    title
                }
            }
        }
    }
}

This will return the current week schedules in UTC starting from Monday to Sunday, the schedules will be identified by the provided ID so it can be updated if it's cancelled.

If the streamer doesn't went live when it's in "startAt" to "endAt" range, it will be set as cancelled and will be ignored.

PR: To be made