Graphrt

YouTube

YouTube channel, videos, comments, moderation and live chat

Beta v0.2.0 Node.js 15 actions ToS risk low
Use in Graphrt Desktop

About

A Graphrt plugin for the official YouTube Data API v3. It reads the authenticated channel and its uploads, edits video metadata, moderates and answers comments, and reads and writes live chat. Every operation is a workflow node and an agent tool.

What it can do

  • Channel and videos: my channel, my uploads, video details, metadata edits (merged, never cleared), delete
  • Comments: list threads (per video or per channel, with search and moderation filters), list replies, post, reply, edit, delete, and moderate (publish / hold / reject, optionally ban the author)
  • Live chat: read messages (with the server's polling interval) and send messages, by chat id or live video id
  • api_request: any other YouTube Data API endpoint, restricted to www.googleapis.com
  • Works with a plain access token or with a refresh token, which the plugin exchanges and caches itself
  • Clear error kinds, the daily quota error is not retried. Tokens and client secrets never appear in errors.

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Get my YouTube channel youtube-api.get_my_channel
  • List my YouTube videos youtube-api.list_my_videos
  • Get YouTube videos youtube-api.get_videos
  • Update YouTube video metadata youtube-api.update_video_metadata
  • Delete YouTube video youtube-api.delete_video
  • List YouTube comment threads youtube-api.list_comment_threads
  • List YouTube comment replies youtube-api.list_comment_replies
  • Post YouTube comment youtube-api.post_comment
  • Reply to YouTube comment youtube-api.reply_to_comment
  • Edit YouTube comment youtube-api.update_comment
Show all 15 actions
  • Delete YouTube comment youtube-api.delete_comment
  • Moderate YouTube comments youtube-api.set_comment_moderation_status
  • List YouTube live chat messages youtube-api.list_live_chat_messages
  • Send YouTube live chat message youtube-api.send_live_chat_message
  • YouTube Data API request youtube-api.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • YOUTUBE_ACCESS_TOKEN
    OAuth access token (expires after about an hour)
  • YOUTUBE_REFRESH_TOKEN
    OAuth refresh token (needs access_type=offline when you authorize)
  • YOUTUBE_CLIENT_ID
    OAuth client id that issued the refresh token
  • YOUTUBE_CLIENT_SECRET
    OAuth client secret
  • YOUTUBE_API_TOOL_TOKEN_SOURCE

How to use it

In Graphrt Desktop

  1. Open Plugins and search for YouTube.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install youtube-api
workflow.yaml
- id: held
  type: youtube-api.list_comment_threads
  channel_id: "{{#start.channel_id#}}"
  moderation_status: heldForReview
- id: reply
  type: youtube-api.reply_to_comment
  parent_id: "{{#start.comment_id#}}"
  text: "Terima kasih sudah menonton!"
Plugins in the docs