How to Specify Video Type in YouTube Video Upload API to Avoid Automatic Conversion to Shorts?

This topic was automatically generated from Slack. You can find the original thread here.

Hi, when I use the youtube video upload api, all the videos are uploaded as youtube shorts, even when I provide 16:9 videos. Is there any way to specify whether to upload as normal or shorts?

I’m really loving pipedream, just got this issu

I’m sorry to hear that you’re experiencing an issue with the YouTube video upload API. To help you better, I’ll need more information about your Pipedream workflow. Can you please provide more details about the steps you’re using, especially the YouTube-related action or custom code you’re using to upload the videos? This will help me understand the issue and provide a solution.

here is the name of the action: youtube_data_api_upload_video

I understand that you’re using the youtube_data_api_upload_video action to upload videos to YouTube, but they’re being uploaded as YouTube Shorts. To help you with this issue, I need more information about your Pipedream workflow. Can you please provide more details about the steps you’re using, especially any custom code or specific parameters you’re setting while using the action? This will help me understand the problem and provide a solution.

here is more information

YouTube (Data API) Account

Title

{{steps.trigger.event.video_title}}

The video’s title
Description

{{steps.trigger.event.video_description}}

The video’s description
File URL

{{steps.trigger.event.video_url}}

The URL of the video file you want to upload to YouTube. Must specify either File URL or File Path.
Optional Fields

Thank you for providing more information about your Pipedream workflow. It seems you’re using the youtube_data_api_upload_video action with the provided Title, Description, and File URL. Regarding your issue with videos being uploaded as YouTube Shorts, the YouTube Data API doesn’t have a specific parameter to control whether a video is uploaded as a normal video or a short. YouTube Shorts are usually identified by their aspect ratio (9:16) and length (less than 60 seconds). Since you mentioned you’re providing 16:9 videos, it’s unusual for them to be treated as Shorts. To further investigate this issue, I recommend checking the following: 1. Ensure that the video files you’re uploading have the correct aspect ratio (16:9) and are longer than 60 seconds. 2. Verify if there’s any issue with the video processing on YouTube’s end. You can try uploading the same video manually through the YouTube website and see if it’s still treated as a Short. If the issue persists, you might want to reach out to YouTube support or check their community forums for any known issues or workarounds.

ok my video is less than 60 seconds. I’ll retry with a longer video and see if it works. I’m so dumb sometimes

Don’t worry, it’s easy to overlook details like video length when working with APIs. Give it a try with a longer video (more than 60 seconds) and see if it resolves the issue. If you still face any problems or have more questions, feel free to ask. I’m here to help!

it now works. the aspect ratio was the issue (1:1). thanks

You’re welcome! I’m glad to hear that the aspect ratio was the issue and it’s working now. If you have any more questions or need further assistance, feel free to ask. I’m here to help!

how do I get the url of the uploaded video?

When you use the youtube_data_api_upload_video action, the response contains the video ID. You can use this video ID to construct the URL of the uploaded video. After the action step, add a custom code step with the following code: export default defineComponent({ async run({ steps }) { const videoId = steps.youtube_data_api_upload_video.$return_value.id; const videoUrl = `https://www.youtube.com/watch?v=${videoId}`; return { videoUrl }; }, }); This code step takes the video ID from the youtube_data_api_upload_video step and constructs the video URL. The URL will be in the format https://www.youtube.com/watch?v=VIDEO_ID.

how do I create a comment and pin the comment after I upload the video via pipedream?

To create a comment and pin it after uploading a video via Pipedream, you can follow these steps: 1. After the youtube_data_api_upload_video action, add another action to create a comment using the youtube_data_api_insert_comment action. Set the videoId parameter to {{steps.youtube_data_api_upload_video.$return_value.id}}. 2. Next, add another action to pin the comment using the youtube_data_api_set_comment_top_level_comment action. Set the commentId parameter to {{steps.youtube_data_api_insert_comment.$return_value.id}}. Your workflow should look like this: 1. Trigger 2. youtube_data_api_upload_video action 3. youtube_data_api_insert_comment action 4. youtube_data_api_set_comment_top_level_comment action Make sure to replace the steps references with the actual step names in your workflow. If you need further assistance or have any questions, feel free to ask.

getting Insufficient Permission error

I’m sorry to hear that you’re encountering an “Insufficient Permission” error. This error usually occurs when the API key or OAuth token used in the request doesn’t have the required permissions to perform the action. To help you resolve this issue, please double-check the following: 1. Ensure that the API key or OAuth token you’re using in your Pipedream workflow has the necessary permissions for the actions you’re trying to perform. 2. Verify that you’re using the correct API key or OAuth token in your workflow. If you’re still facing issues, please provide more information about the specific API or service you’re working with, and the steps in your workflow. This will help me better understand the issue and assist you further.

i’m using YouTube (Data API) Account

To resolve the “Insufficient Permission” error, you need to make sure that the YouTube Data API OAuth token you’re using has the necessary permissions (scopes) for the actions you’re trying to perform. 1. Go to your Pipedream account’s Connected Accounts page. 2. Find the YouTube Data API account you’re using and click on “Edit”. 3. In the “Scopes” section, make sure you have the required scopes for the actions you’re performing. For example, to create and pin comments, you’ll need the following scopes: - https://www.googleapis.com/auth/youtube.force-ssl - https://www.googleapis.com/auth/youtube 4. Save the changes and use the updated OAuth token in your workflow. If you’re still facing issues, please provide more information about the specific steps in your workflow, and I’ll be happy to help you further.

I have the following scopes: emailhttps://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/youtube.readonlyhttps://www.googleapis.com/auth/youtube.uploadprofile

It seems you have the following scopes for the YouTube Data API: - email - https://www.googleapis.com/auth/youtube - https://www.googleapis.com/auth/youtube.readonly - https://www.googleapis.com/auth/youtube.upload - profile These scopes should be sufficient to upload videos, create comments, and pin comments. If you’re still encountering “Insufficient Permission” errors, please double-check that you’re using the correct OAuth token in your Pipedream workflow and that the token has not expired. If the issue persists, please provide more information about the specific steps in your workflow, and I’ll be happy to help you further.