Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: API #878

Open
calzoneman opened this issue Jul 4, 2020 · 6 comments
Open

RFC: API #878

calzoneman opened this issue Jul 4, 2020 · 6 comments

Comments

@calzoneman
Copy link
Owner

Over the years I've gotten several questions about whether CyTube has a supported API, and in particular the frequency of this question seems to be increasing recently. I'm not committing to anything immediately, but I want to open this issue to start a conversation with the community on what use cases people have that they are trying to solve through an API.

I'll start by listing a few possibilities (these are not necessarily mutually exclusive) -- I am looking for your feedback on which kinds of API functionality would be most useful.

Websocket API

The only currently supported way to interact with CyTube is to emulate a socket.io client, as many bot authors have done. This could be improved by (1) documenting the protocol instead of requiring authors to read the client/server code to reverse engineer it, and (2) transitioning to a plain-websocket based API to remove the dependency on socket.io (which is not well-supported outside of the JavaScript ecosystem).

REST API

CyTube could offer a REST API for programmatic manipulation of channels/playlists without establishing a long-running websocket.

Webhooks

CyTube could send event notifications to registered webhooks to enable users to trigger on certain events (e.g. when a video starts playing).

@calzoneman calzoneman pinned this issue Jul 4, 2020
@fais3000
Copy link

fais3000 commented Jul 4, 2020

Thanks for initiating the discussion around this. APIs will definitely expand and grow cytube/sync into many creative integrations. I'm especially interested in rest API. Rest api's are kind of bare minimum these days for most apps. In my use case I would like to use it to showcase the channels and playlist info on sites/pages where there will be marketing content to promote different channels. You can call them landing pages, where users/visitors will get a sneak preview of how you can watch varied content together with friends. This is important for me because that will mean we can have marketing and promotional site as a separate entity e.g (wordpress/ghost) without worrying about messing up the sync engine.

Websockets based API's are cool too, however as you pointed out they are a bit too tied to JS ecosystem. However they can let us do some realtime stuff like this cool demo of how people are using venmo. https://venmo.com/

image

@Xaekai
Copy link
Collaborator

Xaekai commented Jul 19, 2020

I'd definitely want to transition to µWebSockets.js if possible. I know the reddit crowd likes to harp on the guy and not trust him, and I certainly don't blame them, but that fork has been consistently supported since May 6, 2018, it's last commit was just 17 days ago, and it's continued development is financed by 4 large BTC exchanges. It had direct support for Node, Python, C++ and anything that can wrap it.

@ajtran303
Copy link

Hello. I have been using this site for many years and was an original user at synchtube.
Recently I started developing APIs, and I would be happy to contribute to a Websocket API.

@juniperrrrr
Copy link

A simple REST API for manipulating playlists alone would be perfect and prevent the need for modifying bots to use for mundane tasks

@ajtran303
Copy link

A simple REST API for manipulating playlists alone would be perfect and prevent the need for modifying bots to use for mundane tasks

I'd be down for this. Like adding videos to the beginning or end of a playlist?

Crud (Create / read / update / delete) functionality could be pretty useful.

@caspiano
Copy link

caspiano commented Jul 3, 2021

What about a JSON RPC api? It would be pretty simple for other languages to implement over websocket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants