@actionsflow/trigger-youtube 中文文档教程

发布于 3年前 浏览 13 项目主页 更新于 3年前

@actionsflow/trigger-youtube

这是 ActionsflowYoutube 触发器。 Youtube 频道或播放列表中的任何新视频都会触发触发器。

这是一个官方触发器,您不需要手动安装它。

在Github上查看触发器

Usage

Single channel:

on:
  youtube:
    channel_id: UCnCikd0s4i9KoDtaHPlK-JA

Multiple Channels:

on:
  youtube:
    channel_id:
      - UCnCikd0s4i9KoDtaHPlK-JA
      - UCseUQK4kC3x2x543nHtGpzw

Playlist:

on:
  youtube:
    playlist_id: PL99D544ED5B1E58D8

Multiple playlist:

on:
  youtube:
    playlist_id:
      - PL99D544ED5B1E58D8
      - PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-

Or , 频道或播放列表:

on:
  youtube:
    channel_id:
      - UCnCikd0s4i9KoDtaHPlK-JA
      - UCseUQK4kC3x2x543nHtGpzw
    playlist_id:
      - PL99D544ED5B1E58D8
      - PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-

Options

  • channel_id, optional, Youtube channel ID, string or string[], when channel_id is string[], then multiple Youtube channels can trigger the action. You can get it from Youtube channel URL. For example, https://www.youtube.com/channel/UCOmHUn--16B90oW2L6FRR3A, channel_id is UCOmHUn--16B90oW2L6FRR3A
  • playlist_id, optional, Youtube playlist ID, string or string[], when playlist_id is string[], then multiple Youtube playlist can trigger the action. You can get it from Youtube playlist URL. For example, https://www.youtube.com/playlist?list=PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-, playlist_id is PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-, you can use playlist_id and channel_id at the same time.

您可以使用Actionsflow 触发器的常规配置 进行更多自定义。

Outputs

输出示例:

{
  "videoId": "vrBr_vrMdLQ",
  "channelId": "UCnCikd0s4i9KoDtaHPlK-JA",
  "title": "Mechanizing the Methodology",
  "link": "https://www.youtube.com/watch?v=vrBr_vrMdLQ",
  "pubDate": "2020-08-18T11:49:59.000Z",
  "author": "Daniel Miessler",
  "id": "yt:video:vrBr_vrMdLQ",
  "isoDate": "2020-08-18T11:49:59.000Z",
  "description": "How to find vulnerabilities while you're doing other things.",
  "thumbnail": {
    "url": "https://i3.ytimg.com/vi/vrBr_vrMdLQ/hqdefault.jpg",
    "width": "480",
    "height": "360"
  },
  "starRating": {
    "count": "10",
    "average": "5.00",
    "min": "1",
    "max": "5"
  },
  "statistics": {
    "views": "89"
  }
}

您可以像这样使用输出:

on:
  youtube:
    channel_id: UCnCikd0s4i9KoDtaHPlK-JA
jobs:
  print:
    name: Print
    runs-on: ubuntu-latest
    steps:
      - name: Print Outputs
        env:
          title: ${{on.youtube.outputs.title}}
          description: ${{on.youtube.outputs.description}}
          link: ${{on.youtube.outputs.link}}
        run: |
          echo title: $title
          echo description: $description
          echo link: $link

@actionsflow/trigger-youtube

This is a Youtube trigger of Actionsflow. Any new videos in Youtube channel or playlist will trigger the trigger.

This is an official trigger, you don't need to install it manually.

View trigger on Github

Usage

Single channel:

on:
  youtube:
    channel_id: UCnCikd0s4i9KoDtaHPlK-JA

Multiple Channels:

on:
  youtube:
    channel_id:
      - UCnCikd0s4i9KoDtaHPlK-JA
      - UCseUQK4kC3x2x543nHtGpzw

Playlist:

on:
  youtube:
    playlist_id: PL99D544ED5B1E58D8

Multiple playlist:

on:
  youtube:
    playlist_id:
      - PL99D544ED5B1E58D8
      - PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-

Or, Both channel or playlist:

on:
  youtube:
    channel_id:
      - UCnCikd0s4i9KoDtaHPlK-JA
      - UCseUQK4kC3x2x543nHtGpzw
    playlist_id:
      - PL99D544ED5B1E58D8
      - PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-

Options

  • channel_id, optional, Youtube channel ID, string or string[], when channel_id is string[], then multiple Youtube channels can trigger the action. You can get it from Youtube channel URL. For example, https://www.youtube.com/channel/UCOmHUn--16B90oW2L6FRR3A, channel_id is UCOmHUn--16B90oW2L6FRR3A
  • playlist_id, optional, Youtube playlist ID, string or string[], when playlist_id is string[], then multiple Youtube playlist can trigger the action. You can get it from Youtube playlist URL. For example, https://www.youtube.com/playlist?list=PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-, playlist_id is PL2qc-hH9Ip-SSUaZd_G8IxtecK0WZ-af-, you can use playlist_id and channel_id at the same time.

You can use General Config for Actionsflow Trigger for more customization.

Outputs

An outputs example:

{
  "videoId": "vrBr_vrMdLQ",
  "channelId": "UCnCikd0s4i9KoDtaHPlK-JA",
  "title": "Mechanizing the Methodology",
  "link": "https://www.youtube.com/watch?v=vrBr_vrMdLQ",
  "pubDate": "2020-08-18T11:49:59.000Z",
  "author": "Daniel Miessler",
  "id": "yt:video:vrBr_vrMdLQ",
  "isoDate": "2020-08-18T11:49:59.000Z",
  "description": "How to find vulnerabilities while you're doing other things.",
  "thumbnail": {
    "url": "https://i3.ytimg.com/vi/vrBr_vrMdLQ/hqdefault.jpg",
    "width": "480",
    "height": "360"
  },
  "starRating": {
    "count": "10",
    "average": "5.00",
    "min": "1",
    "max": "5"
  },
  "statistics": {
    "views": "89"
  }
}

You can use the outputs like this:

on:
  youtube:
    channel_id: UCnCikd0s4i9KoDtaHPlK-JA
jobs:
  print:
    name: Print
    runs-on: ubuntu-latest
    steps:
      - name: Print Outputs
        env:
          title: ${{on.youtube.outputs.title}}
          description: ${{on.youtube.outputs.description}}
          link: ${{on.youtube.outputs.link}}
        run: |
          echo title: $title
          echo description: $description
          echo link: $link
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文