Skip to content

2316 - youtube component added #2666

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 200 additions & 0 deletions docs/content/docs/reference/components/youtube.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
---
title: "Youtube"
description: "Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube."
---

Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.


Categories: Helpers


Type: youtube/v1

<hr />



## Connections

Version: 1


### OAuth2 Authorization Code

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| clientId | Client Id | STRING | | true |
| clientSecret | Client Secret | STRING | | true |





<hr />



## Actions


### Upload Video
Name: uploadVideo

`Uploads video to Youtube.`

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| file | Video File | FILE_ENTRY | `Video file that will be uploaded.` | true |
| title | Video Title | STRING | `Title of the video.` | true |
| description | Video Description | STRING | `Description of the video.` | true |
| tags | Video Tags | ARRAY <details> <summary> Items </summary> [STRING\($tag)] </details> | `Tags of the video.` | false |
| privacyStatus | Privacy Status | STRING <details> <summary> Options </summary> private, public, unlisted </details> | `Privacy status of the video.` | true |
| categoryId | Video Category ID | STRING | | true |

#### Example JSON Structure
```json
{
"label" : "Upload Video",
"name" : "uploadVideo",
"parameters" : {
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
},
"title" : "",
"description" : "",
"tags" : [ "" ],
"privacyStatus" : "",
"categoryId" : ""
},
"type" : "youtube/v1/uploadVideo"
}
```

#### Output



Type: OBJECT


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| publishedAt | STRING | The date and time when the video was published. |
| channelId | STRING | ID of the channel where the video was uploaded. |
| title | STRING | Title of the video. |
| description | STRING | Description of the video. |
| thumbnails | OBJECT <details> <summary> Properties </summary> &#123;&#123;STRING\(url), INTEGER\(width), INTEGER\(height)&#125;\(default), &#123;STRING\(url), INTEGER\(width), INTEGER\(height)&#125;\(medium), &#123;STRING\(url), INTEGER\(width), INTEGER\(height)&#125;\(high)&#125; </details> | Video thumbnails of different quality. |
| channelTitle | STRING | Title of the channel. |
| tags | ARRAY <details> <summary> Items </summary> [STRING] </details> | Tags of the video. |
| categoryId | STRING | ID of the video category. |
| liveBroadcastContent | STRING | Live broadcasting content. |
| localized | OBJECT <details> <summary> Properties </summary> &#123;STRING\(title), STRING\(description)&#125; </details> | Localized description of the video. |
| publishTime | STRING | The date and time when the video was published. |




#### Output Example
```json
{
"publishedAt" : "",
"channelId" : "",
"title" : "",
"description" : "",
"thumbnails" : {
"default" : {
"url" : "",
"width" : 1,
"height" : 1
},
"medium" : {
"url" : "",
"width" : 1,
"height" : 1
},
"high" : {
"url" : "",
"width" : 1,
"height" : 1
}
},
"channelTitle" : "",
"tags" : [ "" ],
"categoryId" : "",
"liveBroadcastContent" : "",
"localized" : {
"title" : "",
"description" : ""
},
"publishTime" : ""
}
```




## Triggers


### New Video
Name: newVideo

`Triggers when new video is added to a specific channel.`

Type: POLLING

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| identifier | Username/Channel Handle | STRING | `Youtube username or a channel handle (e.g. @Youtube).` | true |


#### Output



Type: OBJECT


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| publishedAt | STRING | The date and time when the video was published. |
| channelId | STRING | ID of the channel where the video was uploaded. |
| title | STRING | Title of the video. |
| description | STRING | Description of the video. |
| thumbnails | OBJECT <details> <summary> Properties </summary> &#123;&#123;STRING\(url), INTEGER\(width), INTEGER\(height)&#125;\(default), &#123;STRING\(url), INTEGER\(width), INTEGER\(height)&#125;\(medium), &#123;STRING\(url), INTEGER\(width), INTEGER\(height)&#125;\(high)&#125; </details> | Video thumbnails of different quality. |
| channelTitle | STRING | Title of the channel. |
| liveBroadcastContent | STRING | Live broadcasting content. |
| publishTime | STRING | The date and time when the video was published. |




#### JSON Example
```json
{
"label" : "New Video",
"name" : "newVideo",
"parameters" : {
"identifier" : ""
},
"type" : "youtube/v1/newVideo"
}
```


<hr />

1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ dependencies {
implementation(project(":server:libs:modules:components:google:google-sheets"))
implementation(project(":server:libs:modules:components:google:google-slides"))
implementation(project(":server:libs:modules:components:google:google-tasks"))
implementation(project(":server:libs:modules:components:google:youtube"))
implementation(project(":server:libs:modules:components:graphql-client"))
implementation(project(":server:libs:modules:components:hacker-news"))
implementation(project(":server:libs:modules:components:http-client"))
Expand Down
3 changes: 3 additions & 0 deletions server/ee/apps/worker-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ dependencies {
implementation(project(":server:libs:modules:components:google:google-slides"))
implementation(project(":server:libs:modules:components:google:google-tasks"))
implementation(project(":server:libs:modules:components:graphql-client"))
implementation(project(":server:libs:modules:components:google:youtube"))
implementation(project(":server:libs:modules:components:graphql-client"))
implementation(project(":server:libs:modules:components:graphql-client"))
implementation(project(":server:libs:modules:components:hacker-news"))
implementation(project(":server:libs:modules:components:http-client"))
implementation(project(":server:libs:modules:components:hubspot"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version="1.0"

dependencies {
api(project(":server:libs:modules:components:google:google-commons"))
implementation("com.google.apis:google-api-services-youtube:v3-rev222-1.25.0")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2025 ByteChef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.youtube;

import static com.bytechef.component.definition.ComponentDsl.component;
import static com.bytechef.component.definition.ComponentDsl.tool;

import com.bytechef.component.ComponentHandler;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDefinition;
import com.bytechef.component.youtube.action.YoutubeUploadVideoAction;
import com.bytechef.component.youtube.connection.YoutubeConnection;
import com.bytechef.component.youtube.trigger.YoutubeNewVideoTrigger;
import com.google.auto.service.AutoService;

/**
* @author Nikolina Spehar
*/
@AutoService(ComponentHandler.class)
public class YoutubeComponentHandler implements ComponentHandler {

private static final ComponentDefinition COMPONENT_DEFINITION = component("youtube")
.title("Youtube")
.description(
"Enjoy the videos and music you love, upload original content, and share it all with friends, family, " +
"and the world on YouTube.")
.icon("path:assets/youtube.svg")
.categories(ComponentCategory.HELPERS)
.connection(YoutubeConnection.CONNECTION_DEFINITION)
.actions(YoutubeUploadVideoAction.ACTION_DEFINITION)
.clusterElements(tool(YoutubeUploadVideoAction.ACTION_DEFINITION))
.triggers(YoutubeNewVideoTrigger.TRIGGER_DEFINITION);

@Override
public ComponentDefinition getDefinition() {
return COMPONENT_DEFINITION;
}
}
Loading