Assigned
Status Update
Comments
sn...@google.com <sn...@google.com> #2
Hi, thanks for reaching out! We are unable to reproduce this issue you're seeing with Youtube Data API. Can you verify and check if you're able to reproduce this using API explorer link? Also, can you share the video ID and channel ID?
Description
- Description: I am encountering an issue where the title and description of uploaded videos are not being set correctly, even though the video is uploading just fine. I am providing the correct data in the API request.
- My code snippet:
const ytClient = new OAuth2Client({
clientId: process.env.YOUTUBE_CLIENT_ID,
clientSecret: process.env.YOUTUBE_CLIENT_SECRET,
redirectUri: process.env.YOUTUBE_AUTH_REDIRECT_URL
})
ytClient.setCredentials(credentials)
const videoResponse = await fetch(videoUrl)
if (!videoResponse.ok) {
const errorText = await videoResponse.text()
console.error(`Unexpected download response ${videoResponse.status} ${videoResponse.statusText}: ${errorText}`)
return setError(videoData._id, "Bad video url")
}
const youtube = google.youtube('v3')
const selectedChannel = socialAuth.youtube.channels.find(channel => channel.selected)
if (!selectedChannel) return setError(videoData._id, "No YouTube channel selected")
const videoOptions = {
kind: "youtube#video",
snippet: {
categoryId: 22,
title: "My video title",
channelId: selectedChannel.channelId,
description: "My video description",
},
status: {
privacyStatus: 'public'
}
}
const media = {
mimeType: 'video/mp4',
body: videoResponse.body
}
const videoRes = await youtube.videos.insert({
media,
auth: ytClient,
part: 'snippet,status'
}, videoOptions)
- Is it 100% reproducible? - Yes