I’m experiencing a peculiar problem with my Zapier setup. It’s designed to fetch a video and thumbnail from Trello and then upload them to YouTube using the title and description from the card.
The odd thing is that Zapier indicates everything has gone smoothly with no error messages appearing. I’ve manually confirmed that both the video and thumbnail are accessible. YouTube even returns a success notification along with a link to the video.
However, when I follow the link, YouTube shows a ‘video unavailable’ error instead of playing the video. I’ve tested this with several YouTube accounts and reviewed all permissions, but the issue persists.
Here’s my JavaScript code that separates the video and thumbnail URLs:
// Access the 'files' field from the inputData
const fileUrl = inputData['files']; // The 'files' field contains the two URLs separated by a comma
// Log the input to verify the value of 'files'
console.log('Input file_url:', fileUrl);
// Check if fileUrl is defined and not empty
if (fileUrl && typeof fileUrl === 'string') {
// Split the fileUrl string into an array based on the comma
const urls = fileUrl.split(',');
// Log the split results to see the URLs
console.log('Split URLs:', urls);
// Assume the first URL is the thumbnail, and the second URL is the video
const thumbnailUrl = urls[0].trim(); // Thumbnail URL is the first item
const videoUrl = urls[1] ? urls[1].trim() : ''; // Video URL is the second item, if present
// Log the video and thumbnail URLs
console.log('Thumbnail URL:', thumbnailUrl);
console.log('Video URL:', videoUrl);
// Output the result
output = {
video_url: videoUrl,
thumbnail_url: thumbnailUrl
};
} else {
// If 'files' is undefined or empty, set output to empty values and log the error
console.log('No valid file_url input found.');
output = {
video_url: '',
thumbnail_url: ''
};
}
Has anyone encountered this problem before? What could be causing the discrepancy between Zapier claiming success and YouTube showing the video as unavailable?